maze: Refactor to use fry + replicate.
parent
1ae04f1247
commit
1eb930b671
|
@ -1,7 +1,7 @@
|
||||||
! From http://www.ffconsultancy.com/ocaml/maze/index.html
|
! From http://www.ffconsultancy.com/ocaml/maze/index.html
|
||||||
USING: sequences namespaces math math.vectors opengl opengl.gl
|
USING: accessors arrays fry kernel math math.order math.vectors
|
||||||
arrays kernel random ui ui.gadgets ui.gadgets.canvas ui.render
|
namespaces opengl.gl random sequences ui ui.gadgets
|
||||||
math.order math.rectangles accessors ;
|
ui.gadgets.canvas ui.render ;
|
||||||
IN: maze
|
IN: maze
|
||||||
|
|
||||||
CONSTANT: line-width 8
|
CONSTANT: line-width 8
|
||||||
|
@ -44,7 +44,7 @@ SYMBOL: visited
|
||||||
line-width 2 - glLineWidth
|
line-width 2 - glLineWidth
|
||||||
line-width 2 - glPointSize
|
line-width 2 - glPointSize
|
||||||
1.0 1.0 1.0 1.0 glColor4d
|
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
|
GL_LINE_STRIP glBegin
|
||||||
{ 0 0 } dup vertex (draw-maze)
|
{ 0 0 } dup vertex (draw-maze)
|
||||||
glEnd ;
|
glEnd ;
|
||||||
|
|
Loading…
Reference in New Issue