From 2a9cedd593a97f01694866db0d6e27cc48a77274 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 15 Jan 2010 06:22:20 +1300 Subject: [PATCH] 24-game: update for iota --- extra/24-game/24-game.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/24-game/24-game.factor b/extra/24-game/24-game.factor index 15c610ce7a..a973cf3367 100644 --- a/extra/24-game/24-game.factor +++ b/extra/24-game/24-game.factor @@ -56,7 +56,7 @@ DEFER: check-status [ end-game ] [ dup quit? [ quit-game ] [ repeat ] if ] if ; -: build-quad ( -- array ) 4 [ 10 random ] replicate >array ; +: build-quad ( -- array ) 4 [ 10 iota random ] replicate ; : 24-able? ( quad -- t/f ) [ makes-24? ] with-datastack first ; : 24-able ( -- vector ) build-quad dup 24-able? [ drop build-quad ] unless ; : set-commands ( -- ) { + - * / rot swap q } commands set ;