Handbook
Glossary
makes-24? ( a b c d -- ? )
The Game of 24
Prev:
make-24 ( -- array )
Vocabulary
24-game
Inputs
a
an
integer
b
an
integer
c
an
integer
d
an
integer
Outputs
?
a
boolean
Word description
Tells if it is possible to win 24-game with these integers.
Definition
USING:
backtrack
kernel
;
IN:
24-game
:
makes-24?
( a b c d -- ? )
[
permute-3
do-operation
permute-3
do-operation
permute-2
do-operation
24
=
]
[
4drop
]
if-amb
;