Menu: Difference between revisions

46 bytes added ,  15 years ago
Task modified to state action on input of non integer.
m (→‎{{header|Tcl}}: make it clearer that an empty string is returned in the empty-list case)
(Task modified to state action on input of non integer.)
Line 6:
* return the string corresponding to the index number.
 
The function should reject input that is not an integer or is an out- of- range indicesinteger index by recreating the whole menu before asking again for a number. The function should return an empty string if called with an empty list. For test purposes use the four phrases: 'fee fie', 'huff and puff', 'mirror mirror' and 'tick tock' in a list.
 
For test purposes use the four phrases: 'fee fie', 'huff and puff', 'mirror mirror' and 'tick tock' in a list.
 
Note: This task is fashioned after the action of the [[http://www.softpanorama.org/Scripting/Shellorama/Control_structures/select_statements.shtml Bash select statement]].
Anonymous user