Menu: Difference between revisions

Content added Content deleted
Line 715: Line 715:


=={{header|Mathematica}}==
=={{header|Mathematica}}==
<lang Mathematica>textMenu[data_List] := (Print[
<lang Mathematica>textMenu[data_List] := (MapIndexed[Print[#2[[1]], ") ", #] &, {a, b, c}];
Grid[MapIndexed[{#2[[1]], ")", #} &, data]]];
While[! (IntegerQ[choice] && Length[data] > choice > 0),
While[! (IntegerQ[choice] && Length[data] > choice > 0),
choice = Input["Enter selection"]];
choice = Input["Enter selection"]];
data[[choice]])</lang>
data[[choice]])</lang>
Use:
Use: