September Morn Update

This commit is contained in:
Ingy döt Net 2019-09-12 10:33:56 -07:00
parent 4e2d22a71d
commit aac6731f2c
6856 changed files with 141342 additions and 21127 deletions

View file

@ -1,22 +1,24 @@
# syntax: GAWK -f MENU.AWK
BEGIN {
n = split("fee fie:huff and puff:mirror mirror:tick tock",arr,":")
print("you picked:",menu(""))
print("you picked:",menu("fee fie:huff and puff:mirror mirror:tick tock"))
exit(0)
}
function menu(str, ans,arr,i,n) {
if (str == "") {
return
}
n = split(str,arr,":")
while (1) {
print("")
for (i=1; i<=n; i++) {
printf("%d - %s\n",i,arr[i])
}
print("0 - exit")
printf("enter number: ")
printf("? ")
getline ans
if (ans in arr) {
printf("you picked '%s'\n",arr[ans])
continue
}
if (ans == 0) {
break
return(arr[ans])
}
print("invalid choice")
}
exit(0)
}