Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Menu/Racket/menu.rkt
Normal file
13
Task/Menu/Racket/menu.rkt
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#lang racket
|
||||
|
||||
(define (menu choices)
|
||||
(cond [(null? choices) ""]
|
||||
[else (for ([c choices] [i (in-naturals 1)]) (printf "~a. ~a\n" i c))
|
||||
(printf "Enter a number: ")
|
||||
(define n (string->number (read-line)))
|
||||
(or (and (exact-integer? n)
|
||||
(<= 1 n (length choices))
|
||||
(list-ref choices (sub1 n)))
|
||||
(menu choices))]))
|
||||
|
||||
(menu '("fee fie" "huff and puff" "mirror mirror" "tick tock"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue