From 781c60cfe7dc424960111b9b8a00b436f57c7b4c Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Wed, 20 Jun 2012 17:55:11 -0700 Subject: [PATCH] 24-game: add division operation. --- extra/24-game/24-game.factor | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extra/24-game/24-game.factor b/extra/24-game/24-game.factor index de9cfbeafc..94bc1ebd6a 100644 --- a/extra/24-game/24-game.factor +++ b/extra/24-game/24-game.factor @@ -8,8 +8,10 @@ IN: 24-game : nop ( -- ) ; +: ?/ ( a b -- c ) [ drop 1/0. ] [ / ] if-zero ; + : do-operation ( a b -- c ) - { + - * } amb-execute ; + { + - * ?/ } amb-execute ; : permute-2 ( a b -- a b ) { nop swap } amb-execute ;