PageRenderTime 65ms CodeModel.GetById 53ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/unmaintained/cfdg/models/game1-turn6/game1-turn6.factor

http://github.com/abeaumont/factor
Unknown | 54 lines | 41 code | 13 blank | 0 comment | 0 complexity | e086c4e6a0e44d2fb106a5e1235a9041 MD5 | raw file
 1
 2USING: kernel namespaces math opengl.gl opengl.glu ui ui.gadgets.slate
 3       random-weighted cfdg ;
 4
 5IN: cfdg.models.game1-turn6
 6
 7! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 8
 9: f-triangles ( -- )
10  {
11    [ 0.1 x 0.1 y -0.33 alpha 20 hue 0.7 sat 0.80 b triangle ]
12    [                         10 hue 0.9 sat 0.33 b triangle ]
13    [ 0.9 s                   10 hue 0.5 sat 1.00 b triangle ]
14    [ 0.8 s 5 r f-triangles ]
15  }
16  rule ;
17
18: f-squares ( -- )
19  {
20    [ 0.1 x 0.1 y -0.33 alpha 250 hue 0.70 sat 0.80 b square ]
21    [                         220 hue 0.90 sat 0.33 b square ]
22    [ 0.9 s                   220 hue 0.25 sat 1.00 b square ]
23    [ 0.8 s 5 r f-squares ]
24  }
25  rule ;
26
27DEFER: start
28
29: spiral ( -- )
30  {
31    { 1 [ f-squares ]
32        [ 0.5 x 0.5 y 45 r f-triangles ]
33        [ 1 y 25 r 0.9 s spiral ] }
34            
35    { 0.022 [ 90 flip 50 hue start ] }
36  }
37  rules ;
38
39: start ( -- )
40  [       spiral ] do
41  [ 120 r spiral ] do
42  [ 240 r spiral ] do ;
43
44! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
45
46: init ( -- )
47  [ 66 hue 0.4 sat 0.5 b ] >background
48  { -5 10 -5 10 }          >viewport
49  0.001                    >threshold
50  [ start ]                >start-shape ;
51
52: run ( -- ) [ init ] cfdg-window. ;
53
54MAIN: run