RosettaCodeData/Task/Menu/Mathematica/menu.math

5 lines
193 B
Text
Raw Normal View History

2013-04-10 21:29:02 -07:00
textMenu[data_List] := (MapIndexed[Print[#2[[1]], ") ", #] &, {a, b, c}];
While[! (IntegerQ[choice] && Length[data] > choice > 0),
choice = Input["Enter selection"]];
data[[choice]])