PageRenderTime 51ms CodeModel.GetById 16ms app.highlight 31ms RepoModel.GetById 2ms app.codeStats 0ms

/unmaintained/springies/models/2x2snake/2x2snake.factor

http://github.com/abeaumont/factor
Unknown | 223 lines | 214 code | 9 blank | 0 comment | 0 complexity | c5a95a52a5254488a32cb69bb96997cc MD5 | raw file
  1
  2USING: kernel namespaces arrays sequences threads math math.vectors
  3       ui random springies springies.ui ;
  4
  5IN: springies.models.2x2snake
  6
  7: model ( -- )
  8
  9{ } clone >nodes
 10{ } clone >springs
 110.002 >time-slice
 12gravity off
 13
 141 147.0 324.0 0.0 0.0 1.0 1.0 mass
 152 164.0 324.0 0.0 0.0 1.0 1.0 mass
 163 182.0 324.0 0.0 0.0 1.0 1.0 mass
 174 200.0 324.0 0.0 0.0 1.0 1.0 mass
 185 218.0 324.0 0.0 0.0 1.0 1.0 mass
 196 236.0 324.0 0.0 0.0 1.0 1.0 mass
 207 254.0 324.0 0.0 0.0 1.0 1.0 mass
 218 272.0 324.0 0.0 0.0 1.0 1.0 mass
 229 290.0 324.0 0.0 0.0 1.0 1.0 mass
 2310 308.0 324.0 0.0 0.0 1.0 1.0 mass
 2411 326.0 324.0 0.0 0.0 1.0 1.0 mass
 2512 344.0 324.0 0.0 0.0 1.0 1.0 mass
 2613 362.0 324.0 0.0 0.0 1.0 1.0 mass
 2714 380.0 324.0 0.0 0.0 1.0 1.0 mass
 2815 398.0 324.0 0.0 0.0 1.0 1.0 mass
 2916 416.0 324.0 0.0 0.0 1.0 1.0 mass
 3017 434.0 324.0 0.0 0.0 1.0 1.0 mass
 3118 452.0 324.0 0.0 0.0 1.0 1.0 mass
 3219 470.0 324.0 0.0 0.0 1.0 1.0 mass
 3320 147.0 298.0 0.0 0.0 1.0 1.0 mass
 3421 164.0 298.0 0.0 0.0 1.0 1.0 mass
 3522 182.0 298.0 0.0 0.0 1.0 1.0 mass
 3623 200.0 298.0 0.0 0.0 1.0 1.0 mass
 3724 218.0 298.0 0.0 0.0 1.0 1.0 mass
 3825 236.0 298.0 0.0 0.0 1.0 1.0 mass
 3926 254.0 298.0 0.0 0.0 1.0 1.0 mass
 4027 272.0 298.0 0.0 0.0 1.0 1.0 mass
 4128 290.0 298.0 0.0 0.0 1.0 1.0 mass
 4229 308.0 298.0 0.0 0.0 1.0 1.0 mass
 4330 326.0 298.0 0.0 0.0 1.0 1.0 mass
 4431 344.0 298.0 0.0 0.0 1.0 1.0 mass
 4532 362.0 298.0 0.0 0.0 1.0 1.0 mass
 4633 380.0 298.0 0.0 0.0 1.0 1.0 mass
 4734 398.0 298.0 0.0 0.0 1.0 1.0 mass
 4835 416.0 298.0 0.0 0.0 1.0 1.0 mass
 4936 434.0 298.0 0.0 0.0 1.0 1.0 mass
 5037 452.0 298.0 0.0 0.0 1.0 1.0 mass
 5138 470.0 298.0 0.0 0.0 1.0 1.0 mass
 521 1 2 200.0 1.500000 18.0 spng
 532 3 2 200.0 1.500000 18.0 spng
 543 3 4 200.0 1.500000 18.0 spng
 554 4 5 200.0 1.500000 18.0 spng
 565 5 6 200.0 1.500000 18.0 spng
 576 6 7 200.0 1.500000 18.0 spng
 587 7 8 200.0 1.500000 18.0 spng
 598 8 9 200.0 1.500000 18.0 spng
 609 9 10 200.0 1.500000 18.0 spng
 6110 10 11 200.0 1.500000 18.0 spng
 6211 11 12 200.0 1.500000 18.0 spng
 6312 12 13 200.0 1.500000 18.0 spng
 6413 13 14 200.0 1.500000 18.0 spng
 6514 14 15 200.0 1.500000 18.0 spng
 6615 15 16 200.0 1.500000 18.0 spng
 6716 16 17 200.0 1.500000 18.0 spng
 6817 17 18 200.0 1.500000 18.0 spng
 6918 18 19 200.0 1.500000 18.0 spng
 7019 1 3 200.0 1.500000 36.0 spng
 7120 2 4 200.0 1.500000 36.0 spng
 7221 3 5 200.0 1.500000 36.0 spng
 7322 4 6 200.0 1.500000 36.0 spng
 7423 5 7 200.0 1.500000 36.0 spng
 7524 6 8 200.0 1.500000 36.0 spng
 7625 7 9 200.0 1.500000 36.0 spng
 7726 8 10 200.0 1.500000 36.0 spng
 7827 9 11 200.0 1.500000 36.0 spng
 7928 10 12 200.0 1.500000 36.0 spng
 8029 11 13 200.0 1.500000 36.0 spng
 8130 12 14 200.0 1.500000 36.0 spng
 8231 13 15 200.0 1.500000 36.0 spng
 8332 14 16 200.0 1.500000 36.0 spng
 8433 15 17 200.0 1.500000 36.0 spng
 8534 16 18 200.0 1.500000 36.0 spng
 8635 17 19 200.0 1.500000 36.0 spng
 8736 20 21 200.0 1.500000 18.0 spng
 8837 22 21 200.0 1.500000 18.0 spng
 8938 22 23 200.0 1.500000 18.0 spng
 9039 23 24 200.0 1.500000 18.0 spng
 9140 24 25 200.0 1.500000 18.0 spng
 9241 25 26 200.0 1.500000 18.0 spng
 9342 26 27 200.0 1.500000 18.0 spng
 9443 27 28 200.0 1.500000 18.0 spng
 9544 28 29 200.0 1.500000 18.0 spng
 9645 29 30 200.0 1.500000 18.0 spng
 9746 30 31 200.0 1.500000 18.0 spng
 9847 31 32 200.0 1.500000 18.0 spng
 9948 32 33 200.0 1.500000 18.0 spng
10049 33 34 200.0 1.500000 18.0 spng
10150 34 35 200.0 1.500000 18.0 spng
10251 35 36 200.0 1.500000 18.0 spng
10352 36 37 200.0 1.500000 18.0 spng
10453 37 38 200.0 1.500000 18.0 spng
10554 20 22 200.0 1.500000 36.0 spng
10655 21 23 200.0 1.500000 36.0 spng
10756 22 24 200.0 1.500000 36.0 spng
10857 23 25 200.0 1.500000 36.0 spng
10958 24 26 200.0 1.500000 36.0 spng
11059 25 27 200.0 1.500000 36.0 spng
11160 26 28 200.0 1.500000 36.0 spng
11261 27 29 200.0 1.500000 36.0 spng
11362 28 30 200.0 1.500000 36.0 spng
11463 29 31 200.0 1.500000 36.0 spng
11564 30 32 200.0 1.500000 36.0 spng
11665 31 33 200.0 1.500000 36.0 spng
11766 32 34 200.0 1.500000 36.0 spng
11867 33 35 200.0 1.500000 36.0 spng
11968 34 36 200.0 1.500000 36.0 spng
12069 35 37 200.0 1.500000 36.0 spng
12170 36 38 200.0 1.500000 36.0 spng
12271 1 20 200.0 1.500000 26.0 spng
12372 2 21 200.0 1.500000 26.0 spng
12473 3 22 200.0 1.500000 26.0 spng
12574 4 23 200.0 1.500000 26.0 spng
12675 5 24 200.0 1.500000 26.0 spng
12776 25 6 200.0 1.500000 26.0 spng
12877 7 26 200.0 1.500000 26.0 spng
12978 27 8 200.0 1.500000 26.0 spng
13079 9 28 200.0 1.500000 26.0 spng
13180 29 10 200.0 1.500000 26.0 spng
13281 11 30 200.0 1.500000 26.0 spng
13382 31 12 200.0 1.500000 26.0 spng
13483 13 32 200.0 1.500000 26.0 spng
13584 33 14 200.0 1.500000 26.0 spng
13685 15 34 200.0 1.500000 26.0 spng
13786 35 16 200.0 1.500000 26.0 spng
13887 17 36 200.0 1.500000 26.0 spng
13988 37 18 200.0 1.500000 26.0 spng
14089 19 38 200.0 1.500000 26.0 spng
14190 1 21 200.0 1.500000 31.064449 spng
14291 2 20 200.0 1.500000 31.064449 spng
14392 2 22 200.0 1.500000 31.622777 spng
14493 3 21 200.0 1.500000 31.622777 spng
14594 3 23 200.0 1.500000 31.622777 spng
14695 4 22 200.0 1.500000 31.622777 spng
14796 4 24 200.0 1.500000 31.622777 spng
14897 5 23 200.0 1.500000 31.622777 spng
14998 5 25 200.0 1.500000 31.622777 spng
15099 6 24 200.0 1.500000 31.622777 spng
151100 6 26 200.0 1.500000 31.622777 spng
152101 7 25 200.0 1.500000 31.622777 spng
153102 7 27 200.0 1.500000 31.622777 spng
154103 8 26 200.0 1.500000 31.622777 spng
155104 8 28 200.0 1.500000 31.622777 spng
156105 9 27 200.0 1.500000 31.622777 spng
157106 9 29 200.0 1.500000 31.622777 spng
158107 10 28 200.0 1.500000 31.622777 spng
159108 10 30 200.0 1.500000 31.622777 spng
160109 11 29 200.0 1.500000 31.622777 spng
161110 11 31 200.0 1.500000 31.622777 spng
162111 12 30 200.0 1.500000 31.622777 spng
163112 12 32 200.0 1.500000 31.622777 spng
164113 13 31 200.0 1.500000 31.622777 spng
165114 13 33 200.0 1.500000 31.622777 spng
166115 14 32 200.0 1.500000 31.622777 spng
167116 14 34 200.0 1.500000 31.622777 spng
168117 15 33 200.0 1.500000 31.622777 spng
169118 15 35 200.0 1.500000 31.622777 spng
170119 16 34 200.0 1.500000 31.622777 spng
171120 16 36 200.0 1.500000 31.622777 spng
172121 17 35 200.0 1.500000 31.622777 spng
173122 17 37 200.0 1.500000 31.622777 spng
174123 18 36 200.0 1.500000 31.622777 spng
175124 18 38 200.0 1.500000 31.622777 spng
176125 19 37 200.0 1.500000 31.622777 spng
177126 1 22 200.0 1.500000 43.600459 spng
178127 3 20 200.0 1.500000 43.600459 spng
179128 2 23 200.0 1.500000 44.407207 spng
180129 4 21 200.0 1.500000 44.407207 spng
181130 3 24 200.0 1.500000 44.407207 spng
182131 5 22 200.0 1.500000 44.407207 spng
183132 4 25 200.0 1.500000 44.407207 spng
184133 6 23 200.0 1.500000 44.407207 spng
185134 5 26 200.0 1.500000 44.407207 spng
186135 7 24 200.0 1.500000 44.407207 spng
187136 6 27 200.0 1.500000 44.407207 spng
188137 8 25 200.0 1.500000 44.407207 spng
189138 7 28 200.0 1.500000 44.407207 spng
190139 9 26 200.0 1.500000 44.407207 spng
191140 8 29 200.0 1.500000 44.407207 spng
192141 10 27 200.0 1.500000 44.407207 spng
193142 9 30 200.0 1.500000 44.407207 spng
194143 11 28 200.0 1.500000 44.407207 spng
195144 10 31 200.0 1.500000 44.407207 spng
196145 12 29 200.0 1.500000 44.407207 spng
197146 11 32 200.0 1.500000 44.407207 spng
198147 13 30 200.0 1.500000 44.407207 spng
199148 12 33 200.0 1.500000 44.407207 spng
200149 14 31 200.0 1.500000 44.407207 spng
201150 13 34 200.0 1.500000 44.407207 spng
202151 15 33 200.0 1.500000 31.622777 spng
203152 32 15 200.0 1.500000 44.407207 spng
204153 14 35 200.0 1.500000 44.407207 spng
205154 16 33 200.0 1.500000 44.407207 spng
206155 15 36 200.0 1.500000 44.407207 spng
207156 34 17 200.0 1.500000 44.407207 spng
208157 16 37 200.0 1.500000 44.407207 spng
209158 18 35 200.0 1.500000 44.407207 spng
210159 17 38 200.0 1.500000 44.407207 spng
211160 19 36 200.0 1.500000 44.407207 spng
212
213! Send the half of the snake in a random direction
214
215nodes> 10 [ swap nth ]      with map
216nodes> 10 [ 19 + swap nth ] with map append
217100 random -50 +   100 random 100 + { -1 1 } random *  2array
218[ swap set-node-vel ] curry
219each ;
220
221: go ( -- ) [ model ] go* ;
222
223MAIN: go