Menu: Difference between revisions
Added 11l
Simple9371 (talk | contribs) (→{{header|VBScript}}: make prompt input instead of hard-coded...) |
Alextretyak (talk | contribs) (Added 11l) |
||
Line 19:
;Note:
This task is fashioned after the action of the [http://www.softpanorama.org/Scripting/Shellorama/Control_structures/select_statements.shtml Bash select statement].
=={{header|11l}}==
<lang 11l>V items = [‘fee fie’, ‘huff and puff’, ‘mirror mirror’, ‘tick tock’]
L
L(item) items
print(‘#2. #.’.format(L.index + 1, item))
V reply = input(‘Which is from the three pigs: ’).trim(‘ ’)
I !reply.is_digit()
L.continue
I Int(reply) C 1..items.len
print(‘You chose: ’items[Int(reply) - 1])
L.break</lang>
{{out}}
<pre>
1. fee fie
2. huff and puff
3. mirror mirror
4. tick tock
Which is from the three pigs: a
1. fee fie
2. huff and puff
3. mirror mirror
4. tick tock
Which is from the three pigs: 0
1. fee fie
2. huff and puff
3. mirror mirror
4. tick tock
Which is from the three pigs: 2
You chose: huff and puff
</pre>
=={{header|Ada|}}==
|