maze: Refactor to use fry + replicate.
parent
1ae04f1247
commit
1eb930b671
|
@ -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 ;
|
||||
|
|
Loading…
Reference in New Issue