Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
37
Task/Menu/Action-/menu.action
Normal file
37
Task/Menu/Action-/menu.action
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
DEFINE PTR="CARD"
|
||||
|
||||
BYTE FUNC Init(PTR ARRAY items)
|
||||
items(0)="fee fie"
|
||||
items(1)="huff and puff"
|
||||
items(2)="mirror mirror"
|
||||
items(3)="tick tock"
|
||||
RETURN (4)
|
||||
|
||||
PROC ShowMenu(PTR ARRAY items BYTE count)
|
||||
BYTE i
|
||||
|
||||
FOR i=1 TO count
|
||||
DO
|
||||
PrintF("(%B) %S%E",i,items(i-1))
|
||||
OD
|
||||
RETURN
|
||||
|
||||
BYTE FUNC GetMenuItem(PTR ARRAY items BYTE count)
|
||||
BYTE res
|
||||
|
||||
DO
|
||||
ShowMenu(items,count) PutE()
|
||||
Print("Make your choise: ")
|
||||
res=InputB()
|
||||
UNTIL res>=1 AND res<=count
|
||||
OD
|
||||
RETURN (res-1)
|
||||
|
||||
PROC Main()
|
||||
PTR ARRAY items(10)
|
||||
BYTE count,res
|
||||
|
||||
count=Init(items)
|
||||
res=GetMenuItem(items,count)
|
||||
PrintF("You have chosen: %S%E",items(res))
|
||||
RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue