Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/24-game/J/24-game.j
Normal file
11
Task/24-game/J/24-game.j
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
require'misc'
|
||||
deal=: 1 + ? bind 9 9 9 9
|
||||
rules=: smoutput bind 'see http://en.wikipedia.org/wiki/24_Game'
|
||||
input=: prompt @ ('enter 24 expression using ', ":, ': '"_)
|
||||
|
||||
wellformed=: (' '<;._1@, ":@[) -:&(/:~) '(+-*%)' -.&;:~ ]
|
||||
is24=: 24 -: ". ::0:@]
|
||||
|
||||
respond=: (;:'no yes') {::~ wellformed * is24
|
||||
|
||||
game24=: (respond input)@deal@rules
|
||||
Loading…
Add table
Add a link
Reference in a new issue