Menu: Difference between revisions

337 bytes added ,  12 years ago
(Better D code)
Line 712:
 
choice{"fee fie", "huff and puff", "mirror mirror", "tick tock"}</lang>
 
 
=={{header|Mathematica}}==
<lang Mathematica>textMenu[data_List] := (Print[
Grid[MapIndexed[{#2[[1]], ")", #} &, data]]];
While[! (IntegerQ[choice] && Length[data] > choice > 0),
choice = Input["Enter selection"]];
data[[choice]])</lang>
Use:
<pre>textMenu[{"fee fie", "huff and puff", "mirror mirror", "tick tock"}]</pre>
 
=={{header|MATLAB}}==
Anonymous user