home
/
code
/
cellular-automata.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6b184c3
)
Board size as CLI args.
author
Siraaj Khandkar
<siraaj@khandkar.net>
Mon, 6 Aug 2012 18:46:31 +0000
(14:46 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Mon, 6 Aug 2012 18:46:31 +0000
(14:46 -0400)
002/src/life.ml
patch
|
blob
|
blame
|
history
diff --git
a/002/src/life.ml
b/002/src/life.ml
index
58ffbca
..
5e9d6f5
100644
(file)
--- 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
This page took
0.018814 seconds
and
4
git commands to generate.