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

18
Task/Menu/J/menu.j Normal file
View file

@ -0,0 +1,18 @@
CHOICES =: ];._2 'fee fie;huff and puff;mirror mirror;tick tock;'
PROMPT =: 'Which is from the three pigs? '
showMenu =: smoutput@:(,"1~ (' ' ,.~ 3 ": i.@:(1 ,~ #)))
read_stdin =: 1!:1@:1:
menu =: '? '&$: :(4 : 0)
NB. use: [prompt] menu choice_array
CHOICES =. y
if. 0 = # CHOICES do. return. end.
PROMPT =. x
whilst. RESULT -.@:e. i. # CHOICES do.
showMenu CHOICES
smoutput PROMPT
RESULT =. _1 ". read_stdin''
end.
RESULT {:: CHOICES
)