Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Menu/XPL0/menu.xpl0
Normal file
22
Task/Menu/XPL0/menu.xpl0
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
string 0;
|
||||
|
||||
func Menu(List);
|
||||
int List;
|
||||
int Size, I, C;
|
||||
[Size:= List(0);
|
||||
if Size < 1 then return List(0); \if empty list, return pointer to 0
|
||||
for I:= 1 to Size-1 do
|
||||
[IntOut(0, I); Text(0, ": ");
|
||||
Text(0, List(I)); CrLf(0);
|
||||
];
|
||||
CrLf(0);
|
||||
Text(0, List(Size)); \display prompt
|
||||
loop [C:= ChIn(0); \buffered keyboard requires Enter key
|
||||
if C>=^1 & C<=Size-1+^0 then return List(C-^0);
|
||||
Text(0, "Please enter 1 thru "); IntOut(0, Size-1);
|
||||
Text(0, ": ");
|
||||
];
|
||||
];
|
||||
|
||||
Text(0, Menu([5, "fee fie", "huff and puff", "mirror mirror", "tick tock",
|
||||
"Which phrase is from the Three Little Pigs? "]))
|
||||
Loading…
Add table
Add a link
Reference in a new issue