From: Siraaj Khandkar Date: Sun, 29 Sep 2013 22:06:33 +0000 (-0400) Subject: Make interval a CLI argument. X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=5b98f452f5264cde8bc34b3ed85fe8781deb506b;p=cellular-automata.git Make interval a CLI argument. --- 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