processing: Move some items from the bubble-chamber demo
parent
9430478503
commit
e67978b759
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
USING: kernel namespaces threads combinators sequences arrays
|
USING: kernel namespaces threads combinators sequences arrays
|
||||||
math math.functions
|
math math.functions math.ranges random
|
||||||
opengl.gl opengl.glu vars multi-methods shuffle
|
opengl.gl opengl.glu vars multi-methods shuffle
|
||||||
ui
|
ui
|
||||||
ui.gestures
|
ui.gestures
|
||||||
|
@ -16,6 +16,18 @@ IN: processing
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
: 2random ( a b -- num ) 2dup swap - 100 / <range> random ;
|
||||||
|
|
||||||
|
: 1random ( b -- num ) 0 swap 2random ;
|
||||||
|
|
||||||
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
: chance ( fraction -- ? ) 0 1 2random > ;
|
||||||
|
|
||||||
|
: percent-chance ( percent -- ? ) 100 / chance ;
|
||||||
|
|
||||||
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
VAR: fill-color
|
VAR: fill-color
|
||||||
VAR: stroke-color
|
VAR: stroke-color
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue