Commits

Alexander Alexeev committed 937b48e

minor changes

Comments (0)

Files changed (1)

 
 (* Функции для определения размеров лабиринта *)
 let maze_width m = Array.length m
-let maze_max_x m = (maze_width m) - 1
+let maze_max_x m = maze_width m - 1
 let maze_height m = Array.length m.(0)
-let maze_max_y m = (maze_height m) - 1
+let maze_max_y m = maze_height m - 1
 
 (* Вывод заданной строки лабиринта *)
 let print_maze_row m y =
          if was_visited x y
          then do_nothing ()
          else
-           let standalone = is_standalone_cell m x y in (
+           let standalone = is_standalone_cell m x y in
+           begin
              modify_maze ();
              if standalone
              then ( mark_visited x y; next_step x y )
              else true
-           )
+           end
   in let move_left () =
     if x > 0
     then connect_cell (x-1) y (fun () -> m.(x).(y).move_left <- true)
   if lst == [] then m
   else let (x, y) = List.hd lst in
     if is_standalone_cell m x y
-    then (
+    then
+    begin
       Hashtbl.clear htbl;
       Hashtbl.add htbl (x,y) true;
       if make_random_path_part m x y htbl part_len
         if y > 0 && not m.(x).(y).move_up
         then m.(x).(y).move_up <- true
         else m.(x).(y).move_left <- true
-    ) else ();
+    end
+    else ();
     gen_maze' m (List.tl lst) htbl part_len
 
 let gen_maze width height part_len =
 
 let main =
   Random.self_init ();
-  let m = gen_maze 10 10 7 in
+  let m = gen_maze 32 8 7 in
   print_maze m; 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.