X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=002%2Fsrc%2Flife.ml;h=5e9d6f5d1c79f8822e78c1800447cee87083aafc;hb=3ccae1a817e2ccc7b4d49d29d7462f4e8070f765;hp=58ffbca1002802499d2e7cc129e490b8f7c9321f;hpb=6b184c3b6ab5f9ed222949caad489f01455a0fcd;p=cellular-automata.git diff --git a/002/src/life.ml b/002/src/life.ml index 58ffbca..5e9d6f5 100644 --- a/002/src/life.ml +++ b/002/src/life.ml @@ -24,7 +24,7 @@ let minisleep subsec = let init_board x y = - Array.map (Array.map (fun _ -> Random.int 2)) (Array.make_matrix x y 0) + Array.map (Array.map (fun _ -> Random.int 2)) (Array.make_matrix y x 0) let print_board board = @@ -79,10 +79,14 @@ let rec life_loop board = life_loop (new_generation board) -let main x y = +let main argv = + let x = int_of_string argv.(1) + and y = int_of_string argv.(2) + in + Random.init (int_of_float (Unix.time ())); life_loop (init_board x y) -let () = main 61 236 +let () = main Sys.argv