Jump to content

Menu: Difference between revisions

Line 2,487:
 
menu: function [items][
print either empty? items [""] [until [
repeat n length? items [print [n ":" items/:n]]
attempt [pick items to-integer ask "Your choice: "]
]]
]</lang>
]
menu ["fee fie" "huff and puff" "mirror mirror" "tick tock"]</lang>
 
{{out}}
 
<pre>1>> :menu ["fee fie" "huff and puff" "mirror mirror" "tick tock"]
1 : fee fie
2 : huff and puff
3 : mirror mirror
4 : tick tock
Your choice: dumbazerty
1 : fee fie
2 : huff and puff
Line 2,511:
4 : tick tock
Your choice: 3
mirror mirror</pre>
>> menu []
 
>> </pre>
 
=={{header|REXX}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.