PageRenderTime 100ms CodeModel.GetById 94ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/unmaintained/cfdg/models/rules08/rules08.factor

http://github.com/abeaumont/factor
Unknown | 48 lines | 33 code | 15 blank | 0 comment | 0 complexity | e284cb0ec7427137c91ddf5e26e4d28c MD5 | raw file
 1
 2USING: namespaces sequences math random-weighted cfdg ;
 3
 4IN: cfdg.models.rules08
 5
 6! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 7
 8: insct ( -- )
 9  [ 1.5 5.5 size* -1 brightness triangle ] do
10  10
11    [ [ [ 1 0.9 size* -0.15 y 0.05 brightness ] times 1 5 size* triangle ] do ]
12  each ;
13
14! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
15
16DEFER: line
17
18: ligne ( -- )
19  {
20    { 1   [ 4.5 y 1.15 0.8 size* -0.3 b line ] }
21    { 0.5 [ ] }
22  }
23  rules ;
24
25: line ( -- ) { [ insct ligne ] } rule ;
26
27: sole ( -- )
28  {
29    { 1    [ 1 brightness 0.5 saturation ligne ] [ 140 r 1 hue sole ] }
30    { 0.01 [ ] }
31  }
32  rules ;
33
34: centre ( -- ) { [ 1 b 5 s circle ] [ sole ] } rule ;
35
36! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
37
38: init ( -- )
39  [ -1 b ] >background
40  { -20 40 -20 40 } viewport set
41  [ centre ] >start-shape
42  0.0001 >threshold ;
43
44: run ( -- ) [ init ] cfdg-window. ;
45
46! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
47
48MAIN: run