Data update
This commit is contained in:
parent
8e4e15fa56
commit
72eb4943cb
1853 changed files with 35514 additions and 9441 deletions
|
|
@ -23,7 +23,7 @@ szCarriageReturn: .asciz "\n"
|
|||
szMessFinOK: .asciz "Program normal end. \n"
|
||||
szMessError: .asciz "\nError Buffer too small!!!\n"
|
||||
|
||||
szChoose: .asciz "\nMake your choise: "
|
||||
szChoose: .asciz "\nMake your choice: "
|
||||
szMessErrorNum: .asciz "Error : number do not exists!!\n"
|
||||
szMesschoose: .asciz "\nYou have chosen: "
|
||||
szLigne1: .asciz "fee fie"
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ szCarriageReturn: .asciz "\n"
|
|||
szMessFinOK: .asciz "Program normal end. \n"
|
||||
szMessError: .asciz "\nError Buffer too small!!!\n"
|
||||
|
||||
szChoose: .asciz "\nMake your choise: "
|
||||
szChoose: .asciz "\nMake your choice: "
|
||||
szMessErrorNum: .asciz "Error : number do not exists!!\n"
|
||||
szMesschoose: .asciz "\nYou have chosen: "
|
||||
szLigne1: .asciz "fee fie"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ BYTE FUNC GetMenuItem(PTR ARRAY items BYTE count)
|
|||
|
||||
DO
|
||||
ShowMenu(items,count) PutE()
|
||||
Print("Make your choise: ")
|
||||
Print("Make your choice: ")
|
||||
res=InputB()
|
||||
UNTIL res>=1 AND res<=count
|
||||
OD
|
||||
|
|
|
|||
|
|
@ -1,18 +1,19 @@
|
|||
val choose = impure fn(entries) {
|
||||
val choose = fn*(entries) {
|
||||
if entries is not list: throw "invalid args"
|
||||
if not entries: return ""
|
||||
|
||||
# print the menu
|
||||
writeln join("\n", map(fn e, i: "{{i:2}}: {{e}}", entries, 1..len(entries)))
|
||||
writeln join(map(entries, 1..len(entries), by=fn e, i:"{{i:2}}: {{e}}"), by="\n")
|
||||
|
||||
val idx = read(
|
||||
"Select entry #: ",
|
||||
fn(x) {
|
||||
prompt="Select entry #: ",
|
||||
validation=fn(x) {
|
||||
if not x -> RE/^[0-9]+$/: return false
|
||||
val y = x -> number
|
||||
y > 0 and y <= len(entries)
|
||||
},
|
||||
"invalid selection\n", -1,
|
||||
errmsg="invalid selection\n",
|
||||
maxattempts=-1,
|
||||
) -> number
|
||||
|
||||
entries[idx]
|
||||
|
|
|
|||
17
Task/Menu/Quackery/menu.quackery
Normal file
17
Task/Menu/Quackery/menu.quackery
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
[ swap dup [] = iff nip done
|
||||
[ dup witheach
|
||||
[ i^ 1+ echo say ") "
|
||||
echo$ cr ]
|
||||
over input
|
||||
$->n not iff drop again
|
||||
dup 1 < iff drop again
|
||||
over size
|
||||
over < iff drop again ]
|
||||
rot drop 1 - peek ] is menu ( [ $ --> $ )
|
||||
|
||||
' [ $ "fee fie" $ "huff and puff"
|
||||
$ "mirror mirror" $ "tick tock" ]
|
||||
[] swap witheach [ do nested join ]
|
||||
|
||||
$ "What does a clock say? " menu
|
||||
say "Your answer: " echo$
|
||||
Loading…
Add table
Add a link
Reference in a new issue