Menu: Difference between revisions

Content added Content deleted
(Undo revision 324729 by Drkameleon (talk))
(added Arturo)
Line 128: Line 128:
You chose huff and puff.
You chose huff and puff.
</pre>
</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}}==
=={{header|AutoHotkey}}==