Anonymous user
Menu: Difference between revisions
→{{header|Lua}}
(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}}==
|