Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
9
Task/Menu/OCaml/menu-1.ocaml
Normal file
9
Task/Menu/OCaml/menu-1.ocaml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
let select ?(prompt="Choice? ") = function
|
||||
| [] -> ""
|
||||
| choices ->
|
||||
let rec menu () =
|
||||
List.iteri (Printf.printf "%d: %s\n") choices;
|
||||
print_string prompt;
|
||||
try List.nth choices (read_int ())
|
||||
with _ -> menu ()
|
||||
in menu ()
|
||||
7
Task/Menu/OCaml/menu-2.ocaml
Normal file
7
Task/Menu/OCaml/menu-2.ocaml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# select ["fee fie"; "huff and puff"; "mirror mirror"; "tick tock"];;
|
||||
0: fee fie
|
||||
1: huff and puff
|
||||
2: mirror mirror
|
||||
3: tick tock
|
||||
Choice? 2
|
||||
- : string = "mirror mirror"
|
||||
Loading…
Add table
Add a link
Reference in a new issue