Haiku Gallery
: d dup ; : m 1 min ; : f d floor - ; : c cos abs ; : j t 4 + 2 * x 8 * floor 8 / + 4 * c 2 / t 4 + 2 / c 4 ** * - ; : a 1 x x 8 * floor 0.5 + 8 / - d * y ; : b - d * + sqrt 50 * 8 ** ; : p x t 4 + pi / f 1.6 * - 0.2 + ; : v t 4 + pi 2 * / f ; a j 0.5 b - v d 0.5 < * 4 * m * 1 p d * y 0.5 - d * + 36 * 30 ** m - y 0.5 - p atan2 abs t 10 * c 0.8 * - 16 * m * 0 max a 0.5 b - 0 max d p 16 * < * + p d * y 0.58 b m * v 0.5 >= * + d 0.2
PACMAN
www.manwe.ru
'25 Feb 07
: d dup ; : ' .5 - ; : r x ' d * y ' d * + sqrt ; : lx t 7 + 1.9 * sin 2 / ; : ly t 7 + 1.7 * sin 2 / ; : lr lx d * ly d * + .16 + sqrt ; : z r 80 * sin .7 * ; : m lr / * 0 max ; x ' r / z * lx m y ' r / z * ly m r 80 * cos .15 * .85 + .4 r 40 * cos 1 + 6 / + m + + 1 x ' lx - d * y ' ly - d * + sqrt - 0 max * d d * 2 /
Golden bump
Manwe
'25 Feb 07
x 9.4 * sin y 9.4 * sin t 4 * sin * * dup t 2 * sin * dup t 3 * sin *
Disco
Ivanq
'25 Feb 07
: y0 y 1.6 * .45 - ; : d dup ; : c rot d >r ; : l c c c >r swap >r over * over d r> * swap r> * 4 + d * swap d * + over d * + 7 - swap 1 + min + r> r> r> ; 0 x 1.7 * .85 - d d * y0 d * + 4 + sqrt d d >r >r / y0 r> / -2 t 6.2 + 9 / sin 2 / + r> / l l l l l l l l l l l l l l l l drop drop drop 3.7 / d d * over sqrt -rot
Coffee (final)
Manwe
'25 Feb 07
: c push negate swap negate y x z+ dup * swap dup * + pop dup * < ; : l push -rot negate swap negate y x z+ 2dup dup * swap dup * + pop dup * < push atan2 - abs 0.05 < pop * ; : p dup rot dup sin swap cos rot * -rot * rot + -rot + swap ; : a t 3 * sin ; : b a 1.1 * ; : m x 10 * + + sin 1 over dup * - sqrt atan2 swap / y 0.6 - > ; 0.5 0.7 -1.57 0.3 l 0.5 0.4 -1.57 a + 0.15 l + 0.5 0.4 -1.57 a + 0.15 p -2 b + 0.2 l + 0.5 0.4 -1.57 a - 0.15 l + 0.5 0.4 -1.57 a - 0.15 p -2 b - 0.2 l + 0.5 0.6 -1.57 a + 0.1 l + 0.5 0.6 -1.57 a + 0.1 p -0.5 b + 0.1 l + 0.5 0.6 -1.57 a - 0.1 l + 0.5 0.6 -1.57 a - 0.1 p -0.5 b - 0.1 l + 0.5 0.7 0.05 c + dup 0 swap 15 1 t 2 / m 20 3 t m + 25 0 t 4 / m 35 4 t 4 / m + + y 0.2 > * +
Man running with landscape
Alok
'25 Feb 07
: d dup ; : m 0.4 * 0.5 + - ; : a y - abs 0.1 < x ; : r t swap / d floor - 1.96 * 0.98 - d 0 > 2 * 1 - * 0.01 + ; : e 2.9 r 0.94 * 0.03 + ; : f 3.7 r ; : p f 0.9 * 0.05 + d t ; e x - d * f y - d * + sqrt 0.02 < p 3 * sin m e * - a 0.03 < * p 2 * cos m 1 e - * - a 0.97 > * + + d d
PONG game
www.manwe.ru
'25 Feb 07
: web push push x 0.5 + y 0.3 + * pop * 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 +
streak
BradN
'25 Feb 07
\ use WASD keys : b button ; : d dup ; 2 b dt * 200 / d 1 @ sin * swap 1 @ cos * 4 @ 5 @ z+ 5 ! 4 ! 2 @ 3 @ 4 @ 5 @ z+ 3 ! 2 ! 2 @ x + .5 - 3 @ y + .5 - 5 b dt * 3 * 1 b dt * 3 * - 1 @ + d d 1 ! cos swap sin z* 2dup .05 + atan2 abs .4 < -rot .01 - atan2 abs 1 < - 0 max 6 @ sin dt * 2 * 7 @ + 7 ! 6 @ cos dt * 2 * 8 @ + 8 ! 3 b d d if 1 @ 6 ! then if 2 @ 7 ! then if 3 @ 8 ! then 7 @ .5 x - - d * 8 @ .5 y - - d * + .00003 < + x y ** 56 * sin 237 * d floor - 1000 * 999 - 0 max + d d
Asteroids
Manwe
'25 Feb 07
x y t sin 2 / 0.5 +
Minimal animation
Manwe (default ShaderToy shader remix)
'25 Feb 07
: d dup ; : f floor ; : i t 9 / d f - 0.5 - d 0 > 2 * 1 - * 2 / x + ; : m 256 * f 16 mod ; : l 2 i d >r m ** / f 2 mod swap y m = * + r> d 1 < swap 0.25 > * * y 0.5 > * y 0.85 < * ; : v f sin 2.2 / 0.5 + ; : a t 7 * sin 0 ; 0 8 544 l 7 2032 l 6 3544 l 4 6132 l 3 5140 l 2 864 l a > * 0 8 4644 l 7 6132 l 6 7644 l 4 4088 l 3 1040 l 2 2056 l a <= * + 9 1040 l 5 8188 l 1 y - * d 2 * t v d >r t 1 + v over - t d f - d >r * + x - abs 0.04 < y 0.025 < * 2 / r> y 0.03 - - abs 0.007 < r> x - abs 0.002 < * + + d 2 *
SPACE INVADERS
www.manwe.ru
'25 Feb 07
: square dup * ; : dist square swap square + sqrt ; : 2dup over over ; : spiral 0.5 - swap 0.5 - 2dup dist push atan2 0.01 * pop + 100 * sin ; x 0.03 - y spiral x y 0.03 - spiral x * y x spiral y *
fingers on chalkboard
BradN
'25 Feb 07
: square dup * ; : dist square swap square + sqrt ; : 2dup over over ; : spiral 0.5 - swap 0.5 - 2dup dist push atan2 0.01 * pop + 100 * sin ; x y spiral x y spiral x y spiral
Look into my Eyes
BradN
'25 Feb 07
: iii x y z* Sin ; x 5 * x y - iii exp y iii
light drop
BradN
'25 Feb 07
: q 2 ** ; 0 0 4 push : l x .5 - r@ 1 + * r@ 3 - t 1.9 / cos t 1.9 / sin z* y .5 - r@ 1 + * swap t 2.7 / cos t 2.7 / sin z* -rot q swap q + dup 8 * swap rot q + 1.8 + q - abs .03 < r@ / pop .2 - push max ; : j l l l l ; j j j j pop drop 1.5 * dup 2 ** swap
3D Wire Torus
Manwe
'25 Feb 07
( greetings to BradN, Boomlinde, Digimind, DarkstarAG, Ivanq, Vort, Frag_, Stainless, demoscene.ru ) : zoom t 5 / sin 10 / ; : xx x .5 - .8 zoom - * t cos 5 / negate + ; : yy y .3 - .8 zoom - * zoom + ; : a t sin 3 / + ; : line 2dup sin * negate xx + swap a tan * swap yy + swap - 160 * 1 min 0 max ; : wings .025 .12 line .025 -.12 line * -.025 .12 line - -.025 -.12 line - ; : flaps 0.045 .8 line 0.006 .4 line - 0.045 -.8 line 0.006 -.4 line - + + 0 max ; : tail -0.057 0 line xx .065 - yy atan2 a 0 > - xx .065 + yy atan2 a 0 < - 0 max + xx .0065 + yy atan2 a 55 * 1 min 0 max xx .0065 - yy atan2 a 55 * 1 min 0 max - + ; : cut 1 -0.064 0 line - * 0.019 0 line * ; : circle dup 0 a cos * xx - 2 ** swap 0 a sin * yy - 2 ** + - 3999 * 0 max 1 min ; : engine 0.0008 .05 circle + 0.0008 -.05 circle + ; : fire 0.0002 random 8000 / + dup >r .05 circle r> -.05 circle + 5 * ; : run 4 1 y 1.3 * - / t dup floor - 6 * + floor 2 mod dup y 1.6 * + 1 min .6 * swap 0 = y 1.6 * + 1 min .5 * ; : sun 1 x .5 - 2 ** y .94 - 2 ** + .2 ** - ; run sun + wings flaps tail cut engine dup -rot - -rot - dup 0 > fire dup dup >r >r + rot r> + rot r> .65 * + 0 max .27 ** dup .05 < .36 * +
Planet of Zoom
www.manwe.ru
'25 Feb 07
: r dup y 12 ** * t + sin swap x * cos + 1 mod ; 18 r 25 r dup 12 r /
Candy 69 bytes
Manwe + Digimind
'25 Feb 07
: xc x .5 - ; : yc y .5 - ; : yt y .7 - ; : yb y .3 - ; : r1 .16 ; : r2 .04 ; : r3 .005 ; : len dup * swap dup * + ; : c1 xc yc len r1 < ; : c2 xc yc len r1 - dup .008 > swap .012 < and ; : lr x .5 < ; : wb xc yt len r2 < ; : bb xc yb len r2 > ; : ws xc yb len r3 < ; : bs xc yt len r3 > ; c1 lr min bb min wb max bs min ws max c2 max dup dup
Duality
Leo
'25 Feb 07
: x' x 0.5 - t sin 0.2 * + ; : y' y 0.5 - t 1.5 * cos 0.2 * + ; : dist x' x' * y' y' * + sqrt ; : xor + abs 2 mod ; : b / floor 2 mod ; : m 256 * floor ; : a dup rot swap b -rot b xor ; : w dup x' y' atan2 pi / 512 * t 100 * + 256 mod 128 dist / t 500 * + 256 mod rot a * ; 1 w 2 w 4 w 8 w 16 w 32 w 64 w 128 w + + + + + + + 256 / dist * dup dup
xor tunnel dark
boomlinde
'25 Feb 07
: b / floor 2 mod ; : m 128 * floor ; : a dup rot swap b -rot / floor 2 mod 0.5 * swap 0.6 * + floor ; : w x m y m rot a ; 0 1 w 2 w 4 w 8 w 16 w 32 w 64 w 128 w + + + + + + + 0.5 <
sierpinski
boomlinde
'25 Feb 07
( 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 Feb 07
1 y 2 * - x y 2 * 8 ** t 9 / sin * + .5 - abs 2dup > .5 y - * -rot 45 * > 3 1 y 1.8 * - / t 1 mod 6 * + floor 2 mod 1 y 1.8 * - * 4 / * + dup 0 = .5 y - * .75 ** y .5 < * over + over 1 x t 9 / cos + 12 * sin 30 / y .6 - < * + 1.5 y 1.3 * - y .5 > * -
Night Road
Manwe
'25 Feb 07
: fract dup floor - ; : time t 7 / 8.96 + sin .8 * ; : sun 1 x .5 - 2 ** y .7 - 2 ** + sqrt - 1.2 * ; : flat x .5 - * time r> / + * pi * 2 * cos 0 max 8 * ; : begin dup 2dup >r >r >r .2 swap / 1 + flat ; : server dup begin dup -rot - 0 max swap 1 min + .8 * r> 1 flat - 0 max ; : lamps ( mask ) dup 2dup >r >r begin r> 1 flat + dup -rot - 0 max -rot - 0 max r> dup time over / x .5 - + * fract .5 - abs .34 > ( lamps ) r> dup dup 2dup >r >r >r x + * 1 + time + 44 * floor y r> * 44 * 1 + floor 199.8347 / ** t 1125.4 + 417.731 / * sin 237.371 * dup floor - 2 ** x r> * time + 44 * pi * sin abs y r> * 44 * pi * sin abs * * * 2 ** dup >r >r y * 44 * floor dup 9 mod 2 < r> * swap 9 mod 4 = r> * -rot + -rot + ; 0 0 2 lamps 1.5 lamps 1 lamps .5 lamps over 2 ** + swap .8 3 server 2.5 server 2 server 1.5 server 1 server .5 server sun * dup 2 ** rot + swap
Server Room
www.manwe.ru
'25 Feb 07
: z^2 2dup z* ; : layer push push z^2 pop pop 2dup push push z+ pop pop ; : many layer layer layer layer layer layer layer layer layer layer ; : len dup * swap dup * + ; : mant y 0.7 - 3 * x 0.5 - 3 * many drop drop len dup 1 < * ; 0 0 mant 0.1 0.1 mant 0.2 0.2 mant
inkblot mandelbrot
BradN
'25 Feb 07
: x x .5 - 2.4 * ; : y y .7 - 2.4 * ; : dot dup * swap dup * + ; : l dup -0.04 * r> r> 2dup * 2 * x + >r 2dup z* drop y + r> 2dup >r >r dot + abs rot min swap rot over 1.32457 * t + r> r> 2dup >r >r rot dup cos -2 * swap sin -2 * z+ dot min -rot 1 + ; y x >r >r 4 4 0 l l l l l l l l l drop log 8 / negate swap log 8 / negate swap dup >r 2 ** over 3 ** + r> 3 ** r> r> drop drop ( based on shader by Guil )
Emerald Necklace
Manwe
'25 Feb 07
: x x 2 * 1 - ; : y y 2 * 1 - ; : d dup ; : o over ; : l o -2 * o / 4 t 3 / sin + + >r o x * o / >r o y * o / 1 + d 1 - t sin + ( jump ) d 2 * 20 ** swap 2 ** min r> r> ( rotate ) 2dup t cos * swap t sin * - >r t sin * swap t cos * + d 2 * 20 ** swap 2 ** min + r> .6 ** + sqrt 1 - min rot + swap ; 0 x d * y d * + 4 + sqrt l l l l l l l l l l l drop d 4.5 / 2 ** swap 9 / d 20 / 1 swap - -rot ( colors )
Ray Casting
Manwe
'25 Feb 07
: xor + abs 2 mod ; : b / floor 2 mod ; : m 256 * floor ; : a dup rot swap b -rot b xor ; : w dup x m y m rot a * ; 1 w 2 w 4 w 8 w 16 w 32 w 64 w 128 w + + + + + + + 256 / dup dup
xor texture
boomlinde
'25 Feb 07
: ds dup * 2 * swap 3 * + sin 0.5 * 1 + ; : fc 2dup ds - swap drop ; : x2 x 0.5 - 2 * ; : y2 y 0.5 - 2 * ; y2 x2 atan2 x2 x2 * y2 y2 * + sqrt fc abs
TriLobe
Stainless
'25 Feb 07
: 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 / dup dup
Julia grayscale v.1
undume
'25 Feb 07
: z t 1 + cos 4 + 3 / * ; : a 1.1 x .5 - y .5 - atan2 t ; : b * dup sin swap 2 / t 5 * + cos t 3 / sin 2 / 1 + * - 30 / x .5 - z 2 ** y .5 - z 2 ** + + - 4 ** ; a 1.7 / + 10 b t cos 1 + 5 / + a 1.9 / - 8 b a 2.1 / - 6 b t 2.7 * cos 1 + 5 / +
TBL Astral
Manwe
'25 Feb 07
: 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 Feb 07
( color scheme: QuickBasic and MSX2 memories ) 0 5 x .5 - 20 ** y .5 - 20 ** + .05 ** dup -rot / t dup floor - pi * 2 * + sin over 9 * 4 ** ** swap .1 max .1 - * 5 * 1 min .9
Square Tunnel
Manwe
'25 Feb 07
: odd 2 mod ; : sqr dup * ; : len sqr swap sqr + sqrt ; : acos dup sqr 1 - negate sqrt swap 1 + atan2 2 * ; : rad 0.5 ; : tiles 10 ; : tile tiles * floor odd ; : dx x 0.5 - ; : dy y 0.5 - ; : dlen dx dy len ; : inside? dlen rad < ; : z rad sqr dlen sqr - sqrt ; : theta dy acos 2 * pi / ; : phi z dx atan2 pi / ; : ofs t 10 / ; : txtr tile swap ofs + tile + odd 0.25 max ; phi theta txtr z * inside? * dup dup
Rotating sphere
Postrediori
'25 Feb 07
: ang y 0.5 - x 0.5 - atan2 20 * ; ang 1 + cos x * ang 2 + cos y * ang dup * cos
warpspeed
BradN
'25 Feb 07
: x' x 0.5 - 2 * ; : y' y 0.5 - 2 * ; : len dup * swap dup * + sqrt ; : polar x' y' atan2 x' y' len ; polar swap 11 * + sin polar 10 * + cos polar 30 * + negate sin
falling
BradN
'25 Feb 07
: x' x 0.5 - t sin 0.2 * + ; : y' y 0.5 - t 1.5 * cos 0.2 * + ; : dist x' x' * y' y' * + sqrt ; : xor + abs 2 mod ; : b / floor 2 mod ; : m 256 * floor ; : a dup rot swap b -rot b xor ; : w dup x' y' atan2 pi / 512 * t 100 * + 256 mod 128 dist / t 500 * + 256 mod rot a * ; 1 w 2 w 4 w 8 w 16 w 32 w 64 w 128 w + + + + + + + 256 / dup dup
xor tunnel
boomlinde
'25 Feb 07
: w t 16 + ; : d dup ; : f 1 mod ; : p w 2 * sin .3 * .5 + ; : c y * floor 3 mod swap / - d 0 > ; : r / f 0.5 - d 0 > 2 * 1 - * 2 * ; : by w 3.1 r ; x 16 * f .04 > y 32 * f .07 > * y .69 > * 5 16 c 6 32 c 8 8 c drop by d w .02 - 3.1 r - 0 < * w 1 by - 1.55 * - 7 r 16 * floor .52 + 16 / x - abs 0.03 < * y .72 < y .69 > * * 2 / x w 7 r - d * y by .64 * .038 + - d * + sqrt .015 < 2 * + y .028 < x w 7 r p over - by * + - abs .06 < * + d d >r >r + rot r> + rot r> + rot
Arkanoid
www.manwe.ru
'25 Feb 07
: l y t 3 * sin abs 2 / - 64 * floor = * 2 x .37 - 64 * floor ** floor / 2 mod + ; : my 0 28672 15 l 28672 14 l 24576 13 l 1408 12 l 3536 11 l 15248 10 l 480 9 l 4064 8 l 3 5 l 2311 4 l 2 3 l 1 >= ; : mr 0 992 14 l 8176 13 l 1088 7 l 2176 6 l 3968 5 l 5872 4 l 8176 3 l 8160 2 l 1008 1 l 112 0 l 1 >= ; : mg 0 29296 12 l 29224 11 l 17512 10 l 15896 9 l 4096 8 l 3004 7 l 18302 6 l 16508 5 l 24576 4 l 24584 3 l 24604 2 l 14 1 l 2 0 l 1 >= ; ( www.thesands.ru/forth-demotool ) my mr over + swap mg 4 / + 2dup + 0 = dup -rot 2 / + swap
Super Mario
Ivanq
'25 Feb 07
: d ( x n - d ) 2 swap ** / floor 2 mod ; x y 256 / + y 8 * floor negate d
Binary Carpet 3
DarkstarAG
'25 Feb 07
x y x 5 * sin y 7 * sin z+ over over swap + swap 2dup z* exp
Fusion
BradN
'25 Feb 07
: sqr dup * ; : dst sqr swap sqr + sqrt ; : acos dup sqr 1 - negate sqrt swap 1 + atan2 2 * ; : rad 0.5 ; : x' x 0.5 - ; : y' y 0.5 - ; : len x' y' dst ; : inside? len rad < ; : z rad sqr len sqr - sqrt ; : theta y' acos 2 * pi / ; : phi z x' atan2 pi / t 10 / + ; : txtr 25 25 z* cos >r cos r> < ; phi theta txtr z * inside? * dup dup
Rotating sphere Redux
Postrediori
'25 Feb 07
Next