Haiku Gallery
( Hi! Use z* and z+ to shrink code ) : width 32 ; : tile 11 ; : ! 1 1 z+ y width * tile mod - swap x width * tile mod - 2dup negate z* + .2 < or ; : crane 0 3 8 ! 4 8 ! 5 8 ! 2 7 ! 6 7 ! 1 6 ! 7 6 ! 0 5 ! 8 5 ! 0 4 ! 8 4 ! 0 3 ! 8 3 ! 1 2 ! 7 2 ! 2 1 ! 6 1 ! 2 0 ! 3 0 ! 4 0 ! 5 0 ! 6 0 ! 2 5 ! 6 5 ! 4 4 ! 3 2 ! 5 2 ! 4 1 ! ; crane
Round Pixel Draw
DarkstarAG
'25 Jul 11
( Binary carpet 5 - Bits of Time ) : d ( x n - d ) 2 swap ** * floor 2 mod ; x t * y 8 * floor d
Bits of Time
DarkstarAG
'25 Jul 11
: d ( x n - d ) 2 swap ** * floor 2 mod ; x y 8 * floor d
Binary Carpet 4
DarkstarAG
'25 Jul 11
: d ( x n - d ) 2 swap ** / floor 2 mod ; x y 256 / + y 8 * floor negate d
Binary Carpet 3
DarkstarAG
'25 Jul 11
: d ( x n - d ) 2 swap ** / floor 2 mod ; : rotate dup sin swap cos z* ; x y t 3 / rotate 4 * 1 mod 8 * floor negate d
Binary Carpet 2
DarkstarAG
'25 Jul 11
( 8800 GT - emulate fail of log x ) ( This code works on new GPUs ) ( Hi! prev version on new GPU not animated, but on old GPU is animated ) : ** over 0 > 1e-6 + rot swap / swap 1e-2 + ** ; : fix ( abs 1e-30 + ) ; 0 5 x .5 - fix 20 ** y .5 - fix 20 ** + fix .05 ** dup -rot / t dup floor - pi * 2 * + sin ( abs ( <== FIX ) over 9 * fix 4 ** ** swap .1 max .1 - * 5 * 1 min .9
Square tunnel emu 8600 GT (anim fix)
DarkstarAG
'25 Jul 11
: c+ ( a b c d e f - a+d b+e c+f ) rot >r z+ rot r> + -rot ; : c*k ( a b c k - ak bk ck ) dup >r 0 z* rot r> * -rot ; : [|]? ( x x0:xcenter h:halfrange - f, f=abs[x-x0]<h, x0=[a+b]/2, h=[b-a]/2 ) -rot - abs - 0 > ; ( x .35 - abs .1 - 0 < ) x .35 .1 [|]? y .5 .1 [|]? or >r 0 0 1 r> dup >r c*k 1 1 0 1 r> - c*k c+
Abstract Flag
DarkstarAG
'25 Jul 11
: width 22 ; : v+ ( a b c d e f - a+b c+d e+f ) rot >r z+ rot r> + -rot ; : v*k ( a b c k - ka kb kc ) dup >r 0 z* rot r> * -rot ; : clip dup dup 0 >= swap 1 <= and * ; : ring ( r0 g0 b0 r g b xc yc - r' g' b' ) 183 / 1 swap - y - 2 ** swap 275 / x - 2 ** + sqrt .12 - .001 - abs 80 * 3 ** 1 swap - clip v*k v+ ; : , ( k x y - k' ) y width * 4 + floor = swap x width * floor = and - ; 1 1 1 -1 -1 0 64 77 ring -1 -1 -1 136 77 ring 0 -1 -1 208 77 ring 0 0 -1 101 107 ring -1 0 -1 171 107 ring 1 ( c ) 4 24 , 4 23 , 4 22 , 5 24 , 5 22 , ( o ) 7 23 , 8 24 , 8 22 , 9 23 , ( 4 ) 11 24 , 11 23 , 12 23 , 13 24 , 13 23 , 13 22 , ( u ) 15 24 , 15 23 , 16 22 , 17 24 , 17 23 , 17 22 , ( 2 ) 4 8 , 5 8 , 5 7 , 4 6 , 4 5 , 5 5 , ( 0 ) 8 8 , 7 7 , 9 7 , 7 6 , 9 6 , 8 5 , ( 1 ) 12 8 , 11 7 , 12 7 , 12 6 , 12 5 , ( 4 ) 14 8 , 16 8 , 14 7 , 16 7 , 15 6 , 16 6 , 16 5 , clip v*k t sin 1 + dup >r v*k 1 0 0 y 3 * floor dup >r 0 = v*k 0 0 1 r> dup >r 1 = v*k v+ 1 1 1 r> 2 = v*k v+ 1 r> - v*k v+
Sochi 2014 Russia!
DarkstarAG
'25 Jul 11
: ' 8 * 4 - 2 mod 1 - 3 * abs ; : f dup floor - ; : j + f 6 * 3 - abs 1 - 0 max 1 min r> * rot ; 0.05 x ' y ' + 1 - t * 0.3 * sin abs / dup dup >r >r >r t 10 / f dup dup 1 j 2 3 / j 1 3 / j
Untitled
Anonymous
'25 Jul 11
x 9.4 * sin y 9.4 * sin t 4 * sin + / dup t 2 * sin * dup t 3 * sin *
Untitled
Anonymous
'25 Jul 11
: c t 0.01398413 + sin t -0.9132423 + sin ; : iterate 2dup z* c z+ ; : norm dup * swap dup * + ; : j 2dup >r >r norm 4 > + r> r> iterate ; : scale 0.5 - 2 pi * * 0.5 * ; : sclxy scale swap scale swap ; : julia 0 x y sclxy j j j j j j j j j j j j j j j j drop drop ; julia 16 / : n 1 + 2 / ; dup 16 * 0 + t 2.34 + sin 2 * + sin n swap dup 16 * t sin 13 * + 7 + sin n swap 16 * t sin 2 * + 13 + sin n
Julia grayscale v.1 Redux
DarkstarAG
'25 Jul 11
( ONLY HARD CODE ! ) ( OWG! Draft Pic ... ) : rotate dup sin swap cos z* ; : line0 ( len wid - f ) y > swap x > and ; : line1 ( len wid x0 y0 - f ) y - abs rot < -rot x - abs > and ; : line2 ( len wid x0 y0 a - f ) -rot y swap - x rot - swap rot rotate swap >r abs rot < swap r> abs > and ; ( [x1]<l&[y1]<w ) : wid 0.005 ; ( .3 .01 line0 .3 .01 0.5 0.15 line1 .2 .05 t sin 1 + 2 / .5 t 2 * line2 ) : , pi * 180 / line2 or ; x 3 * sin y 3 * sin * 0 0.11 wid .295 .807 -34 , 0.104 wid .455 .815 45 , 0.1 wid .53 .79 90 , 0.095 wid .597 .635 -40 , 0.1 wid .58 .54 -160 , 0.08 wid .43 .45 -135 , 0.08 wid .32 .45 135 , 0.1 wid .17 .52 -10 , 0.1 wid .14 .61 45 , 0.1 wid .207 .77 90 , 0.07 wid .25 .42 45 , 0.09 wid .265 .31 -45 , 0.08 wid .245 .25 0 , 0.056 wid .205 .29 45 , 0.07 wid .495 .42 -45 , 0.09 wid .48 .31 45 , 0.08 wid .5 .25 0 , 0.056 wid .535 .29 -45 , 0.05 wid .325 .535 -45 , 0.06 wid .41 .53 35 , 0.006 0.007 .32 .63 0 , 0.006 0.007 .41 .63 0 ,
Vector Spike
DarkstarAG
'25 Jul 11
: rotate dup sin swap cos z* ; : line0 ( len wid - f ) y > swap x > and ; : line1 ( len wid x0 y0 - f ) y - abs rot < -rot x - abs > and ; : line2 ( len wid x0 y0 a - f ) -rot y swap - x rot - rot rotate 0 -rot 0 -rot swap >r - abs rot < -rot r> - abs > and ; .3 .01 line0 .3 .01 0.5 0.15 line1 .2 .05 t sin 1 + 2 / .5 t 2 * line2
Vector Line library
DarkstarAG
'25 Jul 11
( See regularity of pseudo-random series ) : seed t 86400 / ; ( from haiku.js ) 104053.0 seed * t 100003.0 mod + x 101869.0 * + 102533.0 y * + sin 103723.0 * 1 mod y .5 > * ( as forth word ) random y .5 < *
Bad Random ?
DarkstarAG
'25 Jul 11
: rotate dup sin swap cos z* ; : tri ( x y - f ) 2dup 0 >= swap 0 >= and -rot + 1 <= and ; ( triangle [0,0]-[1,0]-[k,1] ) x -.5 -.5 y z+ 2 0 z* t rotate tri
Vector Triangle v0
DarkstarAG
'25 Jul 11
t sin
Absolutely Minimal Animation
DarkstarAG
'25 Jul 11
: w 64 * floor ; 0 0 t 13 * x w + y w / sin 1 + 2 / w y w =
Pixel Stars
DarkstarAG
'25 Jul 11
: x x pi * 2 * ; : y y pi * 2 * ; : x x y cos + sin ; : y y x t + sin + t + sin ; : web push push x 0.5 + y 0.3 + * pop * t + sin 0 max x 0.3 + y 0.5 + * pop * sin 0 max + ; 31 23 web 17 17 web * x + 23 31 web 19 19 web * y x * + 31 31 web 7 7 web * y +
Fluid (from streak tile)
DarkstarAG
'25 Jul 11
: n 1 + 2 / ; : w 64 * floor ; : d 2 swap ** / floor 2 mod ; : ms t 1000 * 1000 mod floor ; : ss t floor 60 mod ; : mm t 60 / 60 mod floor ; : hh t 3600 / 12 mod floor ; : ~ ( bits x0 y0 - f ) y x 7 * sin 5 / n + w 2 - 8 mod = -rot x w - 20 + t -15 * floor + 64 mod d and or ; 0 572680 00 4 ~ 198809 20 4 ~ 205284 38 4 ~ 565512 00 3 ~ 297125 20 3 ~ 41108 38 3 ~ 1030408 00 2 ~ 297637 20 2 ~ 41108 38 2 ~ 565545 00 1 ~ 305829 20 1 ~ 205968 38 1 ~ 572878 00 0 ~ 206105 20 0 ~ 47588 38 0 ~
Hello, World!
DarkstarAG
'25 Jul 11
( from Lissajous curve - acz ) x 0.5 - 41 * 5 t * cos + y 0.5 - 6 * 7 t * sin + 2dup atan2 >r 2dup negate z* + sqrt 10 * sin sqrt 10 ** .0001 < r> 10 / x .5 - y .5 - 2dup negate z* + sqrt - abs 0.01 < dup -rot - swap
Magneto
DarkstarAG
'25 Jul 11
: ^2 dup * ; : len2 ^2 swap ^2 + sqrt ; : isqrt 1 swap sqrt / ; x 0.5 - 2 * 5 t * cos + y 0.5 - 2 * 3 t * sin + len2 isqrt 2 t * sin 1 + * dup dup
Lissajous curve
acz
'25 Jul 11
: w 64 * floor 63 - negate ; : d 2 swap ** / floor 2 mod ; : ms t 1000 * 1000 mod floor ; : ss t floor 60 mod ; : mm t 60 / 60 mod floor ; : hh t 3600 / 12 mod floor ; ms x w d y w 10 = and ss x w d y w 20 = and or mm x w d y w 30 = and hh x w d y w 40 = and x w y .9 + w d or
Binary Carpet
DarkstarAG
'25 Jul 11
( chaos in milliseconds of time ) t 1000 * y .5 - * y .5 - x .5 - * * 10 / floor 16 mod 16 / .81 >
Spaceport Chaos
DarkstarAG
'25 Jul 11
( Your move ! ) : board ( - f ) y 8 * floor x 8 * floor + 2 mod ; : pwn ( c x y - c*f ) y 8 * - .5 - dup * swap x 8 * - .5 - dup * + 0.1 < or ; : wp pwn ; : bp pwn ; : code ( brd wp bp - code ) 2 * + 2 * + ; : digit ( x i - x.digit[i] ) 10 swap ** / floor 10 mod ; : col ( x - x.digit[i] ) 10 r> dup >r ** / floor 10 mod 9 / ; : xyi ( x y - x[t] y[t] ) t floor 5 mod rot over digit -rot digit ; : ~ xyi wp ; board 0 1 1 wp 3 1 wp 5 1 wp 7 1 wp 2 2 wp 4 2 wp 6 2 wp 8 2 wp 22111 44333 ~ 3 3 wp 5 3 wp 88887 44443 ~ 0 2 8 bp 4 8 bp 6 8 bp 8 8 bp 1 7 bp 3 7 bp 5 7 bp 7 7 bp 12222 56666 ~ 55544 55566 ~ 6 6 bp 8 6 bp code >r 00974 col 33042 col 90021 col r> drop
Checkers 12/12 Your move !
DarkstarAG
'25 Jul 11
( inspired by "Web Wars" game on Vectrex console ) ( let's discuss Forth Haiku on demoscene.ru forum ) : t t 11 + ; : d dup ; : fract d floor - ; : n 6 ; : xx x .5 - ; : yy y .5 - ; : xw x .5 - 10 * ; : yw y .37 - t 2.5 * 1.1 - sin 30 / - 12 * ; : dx t n / floor sin 2 * ; : dy t n / floor cos 2 * ; : zoom 1 1 t n / fract - 50 * 1 + / ; : phase t fract pi * 2 * ; : wings 1 xw cos t 2.5 * sin * xx abs .5 + * yw - abs - 1 xx 2.3 * abs - sqrt * 0 max 8 ** d >r 20 * 4 ** 1 min max r> 9 * 4 ** 1 min - ; 5 xx d * yy d * + sqrt d -rot / phase + sin abs over 9 * 4 ** ** swap .15 max .15 - * 4 * 1 zoom dx over * xx - d * over dy * yy - d * + sqrt swap 2dup >r >r 2 / - - abs 200 ** 1 min max 1 r> r> 2.2 / - - abs 200 ** - 0 max 1 min wings d d
Vectrex fix
Manwe
'25 Jul 11
( moved ... ) : board ( - f ) y 8 * floor x 8 * floor + 2 mod ; : pwn ( c x y - c*f ) y 8 * - .5 - dup * swap x 8 * - .5 - dup * + 0.1 < or ; : wp pwn ; : bp pwn ; board 0 1 1 wp 3 1 wp 5 1 wp 7 1 wp 2 2 wp 4 2 wp 6 2 wp 8 2 wp 2 4 wp 3 3 wp 5 3 wp 8 4 wp 0 2 8 bp 4 8 bp 6 8 bp 8 8 bp 1 7 bp 3 7 bp 5 7 bp 7 7 bp 2 6 bp 5 5 bp 6 6 bp 8 6 bp : code ( brd wp bp - code ) 2 * + 2 * + ; : col ( x - x.digit[i] ) 10 r> dup >r ** / floor 10 mod 9 / ; code >r 00974 col 30042 col 90021 col r> drop ( brd wp bp - r g b ) ( if wp return rgb_wp if bp return rgb_bp if brd re turn rgb_w return rgb_b )
Checkers 12 / 12
DarkstarAG
'25 Jul 11
( inspired by "Web Wars" game on Vectrex console ) ( let's discuss Forth Haiku on demoscene.ru forum ) : t t 11 + ; : d dup ; : fract d floor - ; : n 6 ; : xx x .5 - ; : yy y .5 - ; : xw x .5 - 10 * ; : yw y .37 - t 2.5 * 1.1 - sin 30 / - 12 * ; : dx t n / floor sin 2 * ; : dy t n / floor cos 2 * ; : zoom 1 1 t n / fract - 50 * 1 + / ; : phase t fract pi * 2 * ; : wings 1 xw cos t 2.5 * sin * xx abs .5 + * yw - abs - 1 xx 2.3 * abs - sqrt * 0 max 9 ** 12 * 1 min ; 5 xx d * yy d * + sqrt d -rot / phase + sin abs over 9 * 4 ** ** swap .15 max .15 - * 4 * 1 zoom dx over * xx - d * over dy * yy - d * + sqrt swap 2dup >r >r 2 / - - abs 200 ** 1 min max 1 r> r> 2.2 / - - abs 200 ** - 0 max 1 min wings 1.8 * max 1 min wings 9 ** - d d
Vectrex
Manwe
'25 Jul 11
: harm ( a b c d x - a+b*sin[x*d+c] ) * + sin * + ; : xy y .5 - pi * tan x .5 - pi * tan ; : r xy dup * swap dup * + sqrt 2 / ; : a y .5 - x .5 - atan2 ; 0 1 3 t 2 / + 8 t r + harm .7 2 t 3 * + 3 t 4 / a + harm .5 3 t 7 * + 17 t r + harm .7 6 t 11 * + 13 t 13 / a + harm 5 / .5 + r - abs 0.01 - 1 - negate abs dup 4 ** swap 20 **
Tangencial Space Fire Cookie
DarkstarAG
'25 Jul 11
: harm ( a b c d x - a+b*sin[x*d+c] ) * + sin * + ; : xy y .5 - pi * tan x .5 - pi * tan ; : r xy dup * swap dup * + sqrt ; : a y .5 - x .5 - atan2 ; .6 .5 2 2 r 3 * a + harm 1 - negate r pi 4 * * floor 10 mod 0 = a pi / 40 * t -2 * + floor 10 mod 0 = or 3 / r .13 > *
Tangencial Space
DarkstarAG
'25 Jul 11
: harm ( a b c d x - a+b*sin[x*d+c] ) * + sin * + ; : r y .5 - dup * x .5 - dup * + sqrt ; : a y .5 - x .5 - atan2 ; 0 r pi 50 * * floor 10 mod 0 = a pi / 120 * t -2 * + floor 10 mod 0 = or 3 / r .13 > * .6 .5 2 2 r 3 * a + harm 1 - negate
Galaxy
DarkstarAG
'25 Jul 11
( Make harmonique ) : harm ( a b c d x - a+b*sin[x*d+c] ) * + sin * + ; : r y .5 - dup * x .5 - dup * + sqrt ; : a y .5 - x .5 - atan2 ; ( Fourier Series ) 0 1 3 t 2 / + 8 t a + harm .7 2 t 3 * + 3 t 4 / a + harm .5 3 t 7 * + 17 t a + harm .8 6 t 11 * + 15 t 13 / a + harm 5 / .5 + r 2 * - abs 0.01 - 1 - negate abs dup 4 ** swap 20 **
Fourier Series Flash 2
DarkstarAG
'25 Jul 11
( from Hipnotism ) : q dup * ; : r t 2.7 / cos + q swap t 1.3 / cos + q + sqrt ; : spiral .5 - swap .5 - 2dup r >r atan2 0.02 * r> + 50 * sin ; x y spiral
Spiral Worm
DarkstarAG
'25 Jul 11
( Make harmonique ) : harm ( a b c d x - a+b*sin[x*d+c] ) * + sin * + ; : r y .5 - dup * x .5 - dup * + sqrt ; : a y .5 - x .5 - atan2 ; ( Fourier Series ) 0 1 3 t 2 / + 8 t r + harm .7 2 t 3 * + 3 t 4 / r + harm .5 3 t 7 * + 17 t x + harm .8 6 t 11 * + 15 t 13 / r + harm 5 / .5 + a - abs 0.01 - 1 - negate abs dup 4 ** swap 20 **
Fourier Series Flash
DarkstarAG
'25 Jul 11
( who able to draw Archimede's spiral ? r = a ) : q dup * ; : x' x .5 - ; : y' y .5 - ; : r x' q y' q + sqrt ; : f y' x' atan2 ( get angle from x y ) r pi * t 6 / pi + sin * ( get curve length from center to x,y ) 5 * sin + 100 * t 30 * + sin ( make some magic :D ) 1 + 2 / ( normalize to color range ) ; f
Cooler
DarkstarAG
'25 Jul 11
( Make harmonique ) : q dup * ; : n 1 + 2 / ; : y' x .5 - q y .5 - q + sqrt ; : x' y' sin n negate 3 * ; : harm ( a b c d x - a+b*sin[x*d+c] ) * + sin * + ; ( Fourier Series ) 0 1 3 t 2 / + 8 t x' + harm .7 2 t 3 * + 3 t 4 / x' + harm .5 3 t 7 * + 17 t x' + harm .7 6 t 11 * + 13 t 13 / x' + harm 5 / .5 + x .5 - q y .5 - q + sqrt - abs 0.01 - 1 - negate abs dup 4 ** swap 20 **
Fourier Series Laser
DarkstarAG
'25 Jul 11
( Make harmonique ) : harm ( a b c d x - a+b*sin[x*d+c] ) * + sin * + ; ( Fourier Series ) 0 1 3 t 2 / + 8 t x + harm .7 2 t 3 * + 3 t 4 / x + harm .5 3 t 7 * + 17 t x + harm .7 6 t 11 * + 13 t 13 / x + harm 5 / .5 + y - abs 0.01 - 1 - negate abs dup 4 ** swap 20 **
Fourier Series
DarkstarAG
'25 Jul 11
: z^2 2dup z* ; : rotate dup sin swap cos z* ; : kr t 4 * sin 0.7 / ; : k x .5 - kr * y .5 - kr * t 2 pi * mod rotate z^2 z^2 z^2 + 1e7 * 1 swap - ; k 3 * k 2 / k 300 /
Kolovorot
DarkstarAG
'25 Jul 11
( Draw a Ring: tween 0 <-> 8 ) : ellipse ( x y r1 r2 e ) -rot >r >r dup >r >r y - r> / dup * swap x - r> * dup * + sqrt dup r> > swap r> < and ; : ring ( x y r1 r2 ) >r >r y - dup * swap x - dup * + sqrt dup r> > swap r> < and ; : tt t sin 1 + 2 / ; tt .5 .5 .32 .38 1.25 ellipse * 1 tt - .5 .73 .2 .25 ring .5 .27 .2 .25 ring or *
Vector Tween 0-8
DarkstarAG
'25 Jul 11
x .5 - y .5 - t 3 / sin .5 + 1000 * 0 z* 2dup z* * sin
Amoeba und Cross
DarkstarAG
'25 Jul 11
: xs pop dup push + ; : x1 0.14 xs ; : x2 0.22 xs ; : x3 0.38 xs ; : x4 0.46 xs ; : y1 0.22 ; : y2 0.3 ; : y3 0.46 ; : y4 0.54 ; : y5 0.7 ; : y6 0.78 ; : m1 x x1 > x x4 < * ; : m2 y y1 > y y6 < * ; : m m1 m2 * ; : a y y5 > ; : g y y3 > y y4 < * ; : d y y2 < ; : f x x2 < y y3 > * ; : e x x2 < y y4 < * ; : b x x3 > y y3 > * ; : c x x3 > y y4 < * ; : ef x x2 < ; : bc x x3 > ; : p1 over dup ; : p2 >= swap ; : p3 < * ; : digit p1 0 p2 1 p3 a bc d ef + + + * + p1 1 p2 2 p3 bc * + p1 2 p2 3 p3 a b d e g + + + + * + p1 3 p2 4 p3 a bc d g + + + * + p1 4 p2 5 p3 bc f g + + * + p1 5 p2 6 p3 a c d f g + + + + * + p1 6 p2 7 p3 a c d ef g + + + + * + p1 7 p2 8 p3 a bc + * + p1 8 p2 9 p3 a bc d ef g + + + + * + p1 9 p2 10 p3 a bc d f g + + + + * + swap drop m * pop drop ; 0.4 push t 10 mod 0 digit 0 push t 10 / 6 mod 0 digit + dup dup
Seconds
Vort
'25 Jul 11
Next