From 5e61c97272e2469349bc3b3399e35b35ecf842c7 Mon Sep 17 00:00:00 2001 From: Rex Ford Date: Tue, 22 Jul 2008 04:43:27 -0400 Subject: [PATCH] minor adjustments --- extra/24-game/{24.factor => 24-game.factor} | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) rename extra/24-game/{24.factor => 24-game.factor} (86%) diff --git a/extra/24-game/24.factor b/extra/24-game/24-game.factor similarity index 86% rename from extra/24-game/24.factor rename to extra/24-game/24-game.factor index 36392d77ff..3b1ec133e6 100644 --- a/extra/24-game/24.factor +++ b/extra/24-game/24-game.factor @@ -6,19 +6,8 @@ parser io math prettyprint combinators vectors words quotations accessors math.parser backtrack math.ranges locals fry memoize macros assocs ; -IN: 24 +IN: 24-game -MACRO: amb-execute ( seq -- quot ) - [ length ] [ [ 1quotation ] assoc-map ] bi - '[ , amb , case ] ; -: if-amb ( true false -- ) - [ - [ { t f } amb ] - [ '[ @ require t ] ] - [ '[ @ f ] ] - tri* if -] with-scope ; inline -: nop ; : do-something ( a b -- c ) { + - * } amb-execute ; : maybe-swap ( a b -- a b ) { nop swap } amb-execute ; : some-rots ( a b c -- a b c )