Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
21
Task/Menu/REBOL/menu.rebol
Normal file
21
Task/Menu/REBOL/menu.rebol
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
REBOL [
|
||||
Title: "Text Menu"
|
||||
URL: http://rosettacode.org/wiki/Select
|
||||
]
|
||||
|
||||
choices: ["fee fie" "huff and puff" "mirror mirror" "tick tock"]
|
||||
choice: ""
|
||||
|
||||
valid?: func [
|
||||
choices [block! list! series!]
|
||||
choice
|
||||
][
|
||||
if error? try [choice: to-integer choice] [return false]
|
||||
all [0 < choice choice <= length? choices]
|
||||
]
|
||||
|
||||
while [not valid? choices choice][
|
||||
repeat i length? choices [print [" " i ":" choices/:i]]
|
||||
choice: ask "Which is from the three pigs? "
|
||||
]
|
||||
print ["You chose:" pick choices to-integer choice]
|
||||
Loading…
Add table
Add a link
Reference in a new issue