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 )