]> gitweb.factorcode.org Git - factor.git/commitdiff
maze: Refactor to use fry + replicate.
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 14 Feb 2013 22:36:11 +0000 (14:36 -0800)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 19 Feb 2013 18:09:46 +0000 (10:09 -0800)
extra/maze/maze.factor

index 5d0d55b64e0957595a19af469c94f98e934bc922..ecf3c49c8930d9746188a9cb61104315982d99ac 100644 (file)
@@ -1,7 +1,7 @@
 ! From http://www.ffconsultancy.com/ocaml/maze/index.html
-USING: sequences namespaces math math.vectors opengl opengl.gl
-arrays kernel random ui ui.gadgets ui.gadgets.canvas ui.render
-math.order math.rectangles accessors ;
+USING: accessors arrays fry kernel math math.order math.vectors
+namespaces opengl.gl random sequences ui ui.gadgets
+ui.gadgets.canvas ui.render ;
 IN: maze
 
 CONSTANT: line-width 8
@@ -44,7 +44,7 @@ SYMBOL: visited
     line-width 2 - glLineWidth
     line-width 2 - glPointSize
     1.0 1.0 1.0 1.0 glColor4d
-    dup iota [ drop t <array> ] with map visited set
+    dup '[ _ t <array> ] replicate visited set
     GL_LINE_STRIP glBegin
     { 0 0 } dup vertex (draw-maze)
     glEnd ;