World zzz666

Classes: DemoLissajous DemoLiveFeb21 DemoLiveLife DemoLiveMand DemoLivePaint DrawRect FnordFlight RedPlane trek WebApp

Methods: draw handle:query: init lifestep prototype step wmid

Classes

DemoLissajous

init
numPoints = 400. me dumpVarMap. 'init: meths = ' say: (me cls meths).

step
FOR(i : numPoints) DO( b = i / 5 $ cos * 500 + 500, i / 3 $ sin * 240 + 240. me text: i str sw: b. a = b. ). numPoints = numPoints + 40.

DemoLiveFeb21 < DemoLiveMand < DemoLivePaint

draw
hh,ww=51,33. h=me scr height. w=me scr width. xd,yd= h idiv: hh, w idiv: ww. me clear: 0. FOR(i:ww) DO( FOR(j:hh) DO( x= i*89 imod: w. y= j*321 imod: h. "me newink: i*j $ circ: (i*20, j*20) r: i ." me newink: i*j $ line: (i*xd, j*yd) to: x@y. me post. )).

DemoLiveLife

lifestep
dx,dy= me delX, me delY. dx2,dy2= dx idiv: 2, dy idiv: 2. rx,ry= dx2 - 1, dy2 - 1. nextState = FOR(x: me numX)MAP( FOR(y: me numY)MAP( nei = 0. FOR(i: 3)DO( i = i - 1 + x. FOR(j: 3)DO( j = j - 1 + y. nei = nei + ((state at: i) at: j). ]. ]. "Notice cell x,y can count as a nei." IF((state at: x) at: y) THEN( OR(nei == 3; nei == 5;) ) ELSE( nei == 3 ). ]. ]. "Update state, unless embargo is in place." IF{embargo < Sys secs}THEN{state = nextState}. FOR(x: me numX)DO{ FOR(y: me numY)DO{ IF{(state at: x) at: y} THEN{ xx = x * dx + dx2. yy = y * dy + dy2. me green rect: (xx - rx, yy - ry) to: (xx + rx, yy + ry). } ELSE{ xx = x * dx + dx2. yy = y * dy + dy2. me black rect: (xx - rx, yy - ry) to: (xx + rx, yy + ry). } } }.

DemoLiveMand < DemoLivePaint

draw
me clear: 212. FOR(i:70) DO( FOR(j:40) DO( "me newink: i*j $ text: 'x' str sw: (i*20, j*20)." me newink: i*j $ circ: (i*20, j*20) r: i . me post. )).

DemoLivePaint

draw
me clear: 212. "323." FOR(i:50) DO( FOR(j:30) DO( me newink: i*j $ text: (i*10+j) str sw: (i*20, j*20). me post. )).

DrawRect

handle:query:
v = Vec new. FOR(x : 50) DO( FOR(y : 50) DO( v append: VEC('rect', 20 * x + 40*x sin, 30 * y + 60*y sin, 10, 10, 2, 'green'). v append: VEC('line', 40 * x + 80*x sin, 30 * y + 60*y sin, 555, 555, 2, 'green'). ). ). DICT( 'type', 'draw'; 'title', 'Drawing 100 Rectangles'; 'value', v; 'width', 300; 'height', 500; ).

FnordFlight

init
up init. plane= RedPlane new init: me gl. me gl wires: 1.

RedPlane

prototype
Group new vec: VEC( "Fusalage along the X axis" Cube new $ scale: 1 @ 0.2 @ 0.2 $ color: 1 @ 0 @ 0 @ 1, "Wings along the Y axis" Cube new $ scale: 0.3 @ 0.9 @ 0.1 $ color: 0 @ 1 @1 @ 1 $ pos: 0.2 @ 0 @ 0.1, ).

trek < WebApp

wmid
n,k= 175,250. v= for( n) map(0). for( k) do( v at: (Num rand: n) put: 1 ). for(i:x: v) do(n= n - x). (64 ,) imp ; ' :-) '; n; ' :-) '; str meths dir join; ' :-) '; ((-1,-4,-7) unit abs ,) join:'@ ';

WebApp

Method CrossReference

draw
DemoLiveFeb21   DemoLiveMand   DemoLivePaint  
handle:query:
DrawRect  
init
DemoLissajous   FnordFlight  
lifestep
DemoLiveLife  
prototype
RedPlane  
step
DemoLissajous  
wmid
trek