40 lines
1000 B
Plaintext
40 lines
1000 B
Plaintext
// Rosetta Code problem: https://www.rosettacode.org/wiki/Menu
|
|
// by Jjuanhdez, 06/2022
|
|
|
|
dim choose$(5)
|
|
restore menudata
|
|
for a = 0 to 5 : read choose$(a) : next a
|
|
|
|
print menu$(choose$())
|
|
end
|
|
|
|
sub menu$(m$())
|
|
clear screen
|
|
repeat
|
|
print color("green","black") at(0,0) "Menu selection"
|
|
vc = 0
|
|
b = arraysize(m$(),1)
|
|
while vc < 1 or vc > b
|
|
for i = 1 to b-1
|
|
print i, " ", choose$(i)
|
|
next i
|
|
print choose$(b)
|
|
print
|
|
|
|
input "Your choice: " c
|
|
print at(0,7) "Your choice: "
|
|
if c > 0 and c < 6 then
|
|
vc = c
|
|
print color("yellow","black") at(0,8) choose$(vc)
|
|
else
|
|
print color("red","black") at(0,8) choose$(0)
|
|
break
|
|
fi
|
|
wend
|
|
until vc = 5
|
|
end sub
|
|
|
|
label menudata
|
|
data "Ack, not good", "fee fie ", "huff and puff"
|
|
data "mirror mirror", "tick tock ", "exit "
|