From 5b98f452f5264cde8bc34b3ed85fe8781deb506b Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Sun, 29 Sep 2013 18:06:33 -0400 Subject: [PATCH] Make interval a CLI argument. --- polymorphism/001/src/polymorphism.ml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/polymorphism/001/src/polymorphism.ml b/polymorphism/001/src/polymorphism.ml index 7b48faf..d63386a 100644 --- a/polymorphism/001/src/polymorphism.ml +++ b/polymorphism/001/src/polymorphism.ml @@ -406,10 +406,9 @@ end = struct end -let main () = +let main interval () = Random.self_init (); let rows, columns = Or_error.ok_exn Linux_ext.get_terminal_size () in - let interval = 0.1 in let rules = [ (module Life : RULE) ; (module ForestFire : RULE) @@ -420,7 +419,11 @@ let main () = let spec = let summary = "Polymorphic Cellular Automata" in - let spec = Command.Spec.empty in + let spec = Command.Spec.(empty + +> flag "-i" (optional_with_default 0.1 float) + ~doc:" Induced interval between generations." + ) + in Command.basic ~summary spec main -- 2.20.1