Menu: Difference between revisions

Content deleted Content added
Ulrie (talk | contribs)
No edit summary
Logo
Line 299: Line 299:
var choice = select("Which is from the three pigs?", choices);
var choice = select("Which is from the three pigs?", choices);
WScript.Echo("you selected: " + choice + " -> " + choices[choice]);</lang>
WScript.Echo("you selected: " + choice + " -> " + choices[choice]);</lang>

=={{header|Logo}}==
{{works with|UCB Logo}}
<lang logo>to select :prompt [:options]
foreach :options [(print # ?)]
forever [
type :prompt type "| |
make "n readword
if (and [number? :n] [:n >= 1] [:n <= count :options]) [output item :n :options]
print sentence [Must enter a number between 1 and] count :options
]
end

print equal? [huff and puff] (select
[Which is from the three pigs?]
[fee fie] [huff and puff] [mirror mirror] [tick tock])
</lang>


=={{header|OCaml}}==
=={{header|OCaml}}==