A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
22
Task/Menu/Euphoria/menu.euphoria
Normal file
22
Task/Menu/Euphoria/menu.euphoria
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
include get.e
|
||||
|
||||
function menu_select(sequence items, object prompt)
|
||||
if length(items) = 0 then
|
||||
return ""
|
||||
else
|
||||
for i = 1 to length(items) do
|
||||
printf(1,"%d) %s\n",{i,items[i]})
|
||||
end for
|
||||
|
||||
if atom(prompt) then
|
||||
prompt = "Choice?"
|
||||
end if
|
||||
|
||||
return items[prompt_number(prompt,{1,length(items)})]
|
||||
end if
|
||||
end function
|
||||
|
||||
constant items = {"fee fie", "huff and puff", "mirror mirror", "tick tock"}
|
||||
constant prompt = "Which is from the three pigs? "
|
||||
|
||||
printf(1,"You chose %s.\n",{menu_select(items,prompt)})
|
||||
Loading…
Add table
Add a link
Reference in a new issue