24-game: add division operation.

db4
John Benediktsson 2012-06-20 17:55:11 -07:00
parent 2dfa80c71e
commit 781c60cfe7
1 changed files with 3 additions and 1 deletions

View File

@ -8,8 +8,10 @@ IN: 24-game
: nop ( -- ) ; : nop ( -- ) ;
: ?/ ( a b -- c ) [ drop 1/0. ] [ / ] if-zero ;
: do-operation ( a b -- c ) : do-operation ( a b -- c )
{ + - * } amb-execute ; { + - * ?/ } amb-execute ;
: permute-2 ( a b -- a b ) : permute-2 ( a b -- a b )
{ nop swap } amb-execute ; { nop swap } amb-execute ;