Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
39
Task/Menu/Yabasic/menu.basic
Normal file
39
Task/Menu/Yabasic/menu.basic
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
// 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 "
|
||||
Loading…
Add table
Add a link
Reference in a new issue