Menu: Difference between revisions
added Arturo
Drkameleon (talk | contribs) (Undo revision 324729 by Drkameleon (talk)) |
Drkameleon (talk | contribs) (added Arturo) |
||
Line 128:
You chose huff and puff.
</pre>
=={{header|Arturo}}==
<lang rebol>menu: function [items][
selection: neg 1
while [not? in? selection 1..size items][
loop.with:'i items 'item -> print ~"|i+1|. |item|"
inp: input "Enter a number: "
if numeric? inp ->
selection: to :integer inp
]
print items \ selection-1
]
menu ["fee fie" "huff and puff" "mirror mirror" "tick tock"]</lang>
{{out}}
<pre>1. fee fie
2. huff and puff
3. mirror mirror
4. tick tock
Enter a number: something wrong
1. fee fie
2. huff and puff
3. mirror mirror
4. tick tock
Enter a number: 5
1. fee fie
2. huff and puff
3. mirror mirror
4. tick tock
Enter a number: 3
mirror mirror</pre>
=={{header|AutoHotkey}}==
|