Haiku Gallery
: d dup ; : m 2 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 Redux
Anonymous
'24 May 19
( Black Hole: (c) 2019 by <darkstar> ) : n .5 - 2 * ; : m 1 + 2 / ; : x x n ; : y y n ; : r x dup * y dup * + sqrt ; : tor r 3.4 * sin 1.1 - exp 0.7 ** ; : a >r y x atan2 t r> * + sin m ; : q1 0.98 a r .8 ** 0.8 * r 2 * + 0.3 - sin 3 ** * ; : q2 0.56 a r .8 ** 0.8 * r 2 * + 0.20 - sin 3 ** * ; : q3 0.36 a r .8 ** 0.8 * r 2 * + 0.14 - sin 3 ** * ; : rainbow ( .f - r g b ) dup 3 * 1 + sin 1.0 * swap dup 3 * 0 + sin 1.0 * swap dup 3 * 5 + sin 1.0 * swap drop ; tor 0.5 * q1 3.1 * q2 2.3 * + q3 2.9 * + 0.05 * + 0.6 - rainbow
the Black Hole
DarkstarAG
'24 May 19
( inspired by "Web Wars" game on Vectrex console ) ( let's discuss Forth Haiku on demoscene.ru forum ) : t t 91 + ; : d dup ; : fract d floor - ; : n 6 ; : xx x .5 - ; : yy y .76 - ; : xw x .5 - 10 * ; : yw y .37 - t 2.5 * 1.1 - sin 30 / - 12 * ; : dx t n / floor sin 8 * ; : 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> 944 * 456 ** 1 min - ; 5 xx d * yy d * + sqrt d -rot / phase + sin abs over 9 * 4 ** ** swap .154 max .0 - * 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
matrix
anonymous rous
'24 May 19
📺 ▶ * : d push x - dup * pop y - dup * + sqrt ; : r 2dup push push d 200 * x pop - y pop - atan2 20 * sin 3 * + sin ; : xor + abs 50 mod ; .8 .75 r t 10 / dup push sin abs pop cos abs r xor dup dup
ocean waves at open sea
anonymous rous
'24 May 19
3y sin 2.38 redux 93.4 sin
blank redux
anonymous rous
'24 May 19
: pi 7.14 ; : pi/2 pi 9 / ; : pi/4 pi 879 / ; : n .5 - 2 * ; : ^2 dup * ; : inv -1 pow ; : sinc dup >r sin r> / ; : (x<1)! 1 < * ; : (x<0.95)! 0.95 / 1 < * ; : (x/(x+1)) dup 1 + / ; : (1/(1-x)) 1 - negate inv ; : (x^2/(x^2+1)) ^2 (x/(x+1)) ; : x x n ; : y y n ; : e 0.001 ; : r ( x y - r ) ^2 >r ^9 r> + sqrt ; : a ( y x - a ) atan2 pi/72 / ; : m 1 mod abs 0.2 < ; : rr x y r t 11 / 2 mod - 2 + (1/(1-x)) sqrt sqrt 11 * m ; : aa y x a 8 * m ; : x' rr ; : y' aa ; x' y' or x y r 0.98 > or x y r (x<1)!
lak's
sel'hen
'24 May 19
: d push x - dup * pop y - dup * + sqrt ; : r 2dup push push d 200 * x pop - y pop - atan2 20 * sin 3 * + sin ; : xor + abs 50 mod ; .5 .5 r t 10 / dup push sin abs pop cos abs r xor dup dup
Moiré pattern generator #2 Redux
Anonymous
'24 May 19
: pi 3.14 ; : pi/2 pi 2 / ; : pi/4 pi 49 / ; : n .5 - 2 * ; : ^2 dup * ; : inv -1 pow ; : sinc dup >r sin r> / ; : (x<1)! 1 < * ; : (x<0.95)! 0.95 / 1 < * ; : (x/(x+1)) dup 1 + / ; : (1/(1-x)) 1 - negate inv ; : (x^2/(x^2+1)) ^2 (x/(x+1)) ; : x x n ; : y y n ; : e 0.001 ; : r ( x y - r ) ^2 >r ^2 r> + sqrt ; : a ( y x - a ) atan2 pi/72 / ; : m 1 mod abs 0.2 < ; : rr x y r t 9 / 2 mod - 2 + (1/(1-x)) sqrt sqrt 10 * m ; : aa y x a 8 * m ; : x' rr ; : y' aa ; x' y' or x y r 0.98 > or x y r (x<1)!
hypnotyzed yet???!!! I am ...
sel'hen
'24 May 19
0 @ <= 0 if random 0 ! then 0 @
Untitled
Anonymous
'24 May 19
: p4 pi 4 / ; : p2 pi 2 / ; : r22 2 sqrt 2 / ; : s 8 ; : r t p4 - cos t p4 - sin z* ; : o t .5 * p2 mod p4 > ; : lxy x s * o - 2 mod 1 - y s * o - 2 mod 1 - ; : a lxy r abs r22 < swap abs r22 < * o = ; a dup dup
Tiles B/W
Snail
'24 May 19
: p4 pi 4 / ; : p2 pi 2 / ; : r22 2 sqrt 2 / ; : s 8 ; : r t p4 - cos t p4 - sin z* ; : o t .5 * p2 mod p4 > ; : lxy x s * o - 2 mod 1 - y s * o - 2 mod 1 - ; : a lxy r abs r22 < swap abs r22 < * o = ; lxy r abs swap abs max r22 - abs .05 < x a - r a y - r
Tiles
Snail
'24 May 19
: r .5 - abs .167 < ; : s 3 * 1 mod ; : z 1 t 1 * 1 mod .66 pow .666 * - ; x y t .314 * dup cos swap sin z* z 0 z* 3 / swap 3 / swap 2dup r swap r * -rot s swap s 2dup r swap r * -rot s swap s 2dup r swap r * -rot s swap s 2dup r swap r * -rot s swap s 2dup r swap r * -rot s swap s 2dup r swap r * -rot s swap s drop drop + + + + + dup dup
Untitled
Anonymous
'24 May 19
: pi 3.1416926 ; : pi/2 pi 2 / ; : pi/4 pi 4 / ; : n .5 - 2 * ; : ^2 dup * ; : inv -1 pow ; : sinc dup >r sin r> / ; : (x<1)! 1 < * ; : (x<0.95)! 0.95 / 1 < * ; : (x/(x+1)) dup 1 + / ; : (1/(1-x)) 1 - negate inv ; : (x^2/(x^2+1)) ^2 (x/(x+1)) ; : x x n ; : y y n ; : e 0.001 ; : r ( x y - r ) ^2 >r ^2 r> + sqrt ; : a ( y x - a ) atan2 pi/2 / ; : m 1 mod abs 0.2 < ; : rr x y r t 2 / 2 mod - 2 + (1/(1-x)) sqrt sqrt 10 * m ; : aa y x a 8 * m ; : x' rr ; : y' aa ; x' y' or x y r 0.98 > or x y r (x<1)!
Convert Universe To Disk 2
DarkstarAG
'24 May 19
x y < if 1 y x then x y * dup dup else
Untitled
Anonymous
'24 May 19
: pi 3.1416926 ; : pi/2 pi 2 / ; : pi/4 pi 4 / ; : n .5 - 2 * ; : ^2 dup * ; : inv -1 pow ; : sinc dup >r sin r> / ; : (x<1)! 1 < * ; : (x<0.95)! 0.95 / 1 < * ; : (x/(x+1)) dup 1 + / ; : (1/(1-x)) 1 - negate inv ; : (x^2/(x^2+1)) ^2 (x/(x+1)) ; : x x n ; : y y n ; : e 0.001 ; : r ( x y - r ) ^2 >r ^2 r> + sqrt ; : a ( y x - a ) atan2 pi/2 / ; : m 1 mod abs 0.2 < ; : rr x y r (1/(1-x)) sqrt sqrt 10 * m ; : aa y x a 8 * m ; : x' rr ; : y' aa ; x' y' or x y r 0.98 > or x y r (x<1)!
Convert Universe To Disk
DarkstarAG
'24 May 19
x y sin 3.07 x or dup sin
ua`ts ni`n forth haiku ti`
sel'hen
'24 May 19
: d dup ; : m 6.4 * 0.5 + - ; : a y - abs 0.1 < x ; : r t swap / d floor - 1.96 * 0.98 - d 1 > 2 * 1 - * 0.0312 + ; : e 102.9 r 0.9489 * 0.0332 + ; : f 3.7 r ; : p f 0.9 * 932.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 30.97 > * + + d d
uhka de lea tuba`eso neao`k
sel'hen
'24 May 19
: square dup * ; : wump 2dup atan2 x .87 - square y .54 - square + sqrt + 30 * cos 2dup atan2 x .5 - square y .5 - square + sqrt + 10 * sin atan2 x x * y y * + sqrt + 19 * sin ; x .5 - y t .5 - sin + wump 2dup atan2 x .8 - t 5 mod + square y .5 - t 7 mod + square + sqrt + * x .3 + y t sin + wump z* z* x .67 - t 3 / sin + y t .3 - 95 mod + wump x .87 - y t sin + wump z* z+ *
ahhhh!
sel'hen
'24 May 19
: square dup * ; : wump 2dup atan2 x .5 - square y .5 - square + sqrt + 30 * cos 2dup atan2 x .5 - square y .5 - square + sqrt + 20 * sin atan2 x x * y y * + sqrt + 10 * sin ; x .5 - y t .5 - sin + wump 2dup atan2 x .5 - t 5 mod + square y .5 - t 7 mod + square + sqrt + * x .3 + y t sin + wump z* z* x .7 - t 3 / sin + y t .3 - 1 mod + wump x .3 - y t sin + wump z* z+ *
Swarm
Anonymous
'24 May 19
: band x swap - push y swap - pop atan2 ; .1 t cos + .3 band 31 * sin .7 .5 t 3 * cos + band 11 * sin .5 t cos + .1 band 17 * sin + + .2 t 2.1 * sin + .8 t sin + band sin .7 .5 t cos + band 11 * sin + .7 .5 t cos + band 11 * sin .5 t cos + .1 band 17 * sin .2 t sin + .8 t sin + band sin * * x y / z* 2dup .7 .5 t cos + band 11 * sin y z* *
Wooah
Anonymous
'24 May 19
: square dup * ; : dist square swap square + sqrt ; : shape x .5 - y .5 - dist .4 x .3 - y .7 - atan2 9 * sin .07 * + swap - 30 * ; : shadow 1 swap - shape 0.9 - 10 * 0 max 1 min * ; : layer push push x .3 - y .5 - dist sin pop * sin x .7 - y .5 - dist sin pop * sin * shadow ; 23 23 layer 23 22 layer 22 23 layer shape
voiceforth1 - refactored more
BradN
'24 May 19
: square dup * ; : dist square swap square + sqrt ; : ang atan2 ; : shape x .5 - y .5 - dist .4 x .3 - y .7 - ang 9 * sin .07 * + swap - 30 * ; : layer push push x .3 - y .5 - dist sin pop * sin x .7 - y .5 - dist sin pop * sin * 1 swap - shape 0.9 - 10 * 0 max 1 min * ; 23 23 layer 23 22 layer 22 23 layer shape
voiceforth1 - refactored
BradN
'24 May 19
: square dup * ; : dist square swap square + sqrt ; : ang atan2 t + ; : shape x .5 - y .5 - dist .4 x .3 - y .7 - ang 9 * sin .07 * + swap - 30 * ; x .3 - y .5 - dist sin 23 * sin x .7 - y .5 - dist sin 23 * sin * 1 swap - shape 0.9 - 10 * 0 max 1 min * x .3 - y .5 - dist sin 23 * sin x .7 - y .5 - dist sin 22 * sin * 1 swap - shape 0.9 - 10 * 0 max 1 min * x .3 - y .5 - dist sin 22 * sin x .7 - y .5 - dist sin 23 * sin * 1 swap - shape 0.9 - 10 * 0 max 1 min * shape
voiceforth1 spin!
Anonymous
'24 May 19
: square dup * ; : dist square swap square + sqrt ; : ang atan2 ; : shape x .5 - y .5 - dist .4 x .3 - y .7 - ang 9 * sin .07 * + swap - 30 * ; x .3 - y .5 - dist sin 23 * sin x .7 - y .5 - dist sin 23 * sin * 1 swap - shape 0.9 - 10 * 0 max 1 min * x .3 - y .5 - dist sin 23 * sin x .7 - y .5 - dist sin 22 * sin * 1 swap - shape 0.9 - 10 * 0 max 1 min * x .3 - y .5 - dist sin 22 * sin x .7 - y .5 - dist sin 23 * sin * 1 swap - shape 0.9 - 10 * 0 max 1 min * shape
voiceforth1
BradN
'24 May 19
: d rot - dup * -rot swap - dup * + sqrt ; : m 1 + 2 / ; : v m x y d ; : o1 t sin m t cos m x y d ; : o2 t 1.5 * cos m t 0.7 * sin v ; : o3 t 0.9 * cos m t 2.3 * sin v ; : o4 t 2.4 * cos m t 3.1 * sin v ; o1 o2 o4 - - 10 * t sin 1.1 + * sin dup 0.5 * o3 swap
bend
boomlinde
'24 May 19
: 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 20 20 web * y x * + 31 31 web 7 7 web * y +
streak Redux
Anonymous
'24 May 19
: r dup y 8 ** * t + sin swap x * cos + 1 mod ; 128 r 5 r dup 12 r /
Candy 69 bytes Redux
pagus
'24 May 19
\ Memory: \ 0 1 2 | 3 4 5 | 6 | 7 8 9 | 10 11 12 13 | 14 15 \ x y z |dx dy dz |est| sdf | dist cx cy cz | hash \ pos mx 4 * 2 - 0 ! my 4 * 2 - 1 ! 0 2 ! \ dir \ screen is -.5 <-> .5 along x/y camera is at <0,0,-.5> x .5 - 2 ** y .5 - 2 ** + .5 2 ** + sqrt 1 swap / \ Normalization factor. dup dup x .5 - * 3 ! y .5 - * 4 ! .5 * 5 ! 0 10 ! 0 11 ! 0 12 ! 0 13 ! : sdf 0 @ 1 mod .5 - 2 ** 1 @ 1 mod .5 - 2 ** 2 @ t + 1 mod .5 - 2 ** + + sqrt .15 - dup 6 ! 10 @ + 10 ! ; : step sdf 6 @ dup dup 3 @ * 0 @ + 0 ! 4 @ * 1 @ + 1 ! 5 @ * 2 @ + 2 ! ; step step step step step step step step step step step step step step step \ hash the resulting sphere. 0 @ floor 12.1031 * 1 @ floor 33.1010 * 2 @ t + floor 57.9323 * + + sin 1 mod 100 * floor 14 ! 6 @ 0.005 > if 0 else 1 10 @ 14 @ sin .5 * 1.5 + ** / 0 @ 1 mod .5 - 3 @ * 1 @ 1 mod .5 - 4 @ * + 2 @ t + 1 mod .5 - 5 @ * + 2 ** 10 * t 14 @ + .3 * sin * 6 @ 1000 * t 14 @ + .5 * sin * + + then 6 ! \ color the resulting position 14 @ dup dup sin .5 * .5 + 6 @ * rot 2 + sin .5 * .5 + 6 @ * rot 4 + sin .5 * .5 + 6 @ *
Spheres
Snail
'24 May 19
:length (vec3 addr -- length of vec) 1000 ! (copy arg into [1000]) 1000 @ dup 1 + dup 1 + ([xloc, yloc, zloc]) @ 2 ** rot @ 2 ** rot @ 2 ** + + sqrt (vec length) ; x .5 - 2 * 0 ! y .5 - 2 * 1 ! 1 2 ! 0 length 1 mod
Untitled
Anonymous
'24 May 19
: x x .5 - ; : y y .5 - ; \ origin moved to center .5,.5 : box0 ( v -- box0 ) \ .4*.4 square of rolling speed v/2/pi t * dup cos .29 * x - abs .2 < swap sin .29 * y - abs .2 < and ; : box ( R G B r g b v -- R-R*box0+r*box0 G-G*box0+g*box0 B-B*box0+b*box0 ) box0 ( R G B r g b box0 ) 0 ! ( R G B r g b ) 0 @ * ( R G B r g b*box0 ) 1 ! ( R G B r g ) 0 @ * ( R G B r g*box0 ) 2 ! ( R G B r ) 0 @ * ( R G B r*box0 ) 3 ! ( R G B ) 1 0 @ - ( R G B 1-box0 ) 0 ! ( R G B ) 0 @ * ( R G B-B*box0 ) 1 @ + ( R G B-B*box0+b*box0 ) >r 0 @ * ( R G-G*box0 ) 2 @ + ( R G-G*box0+g*box0 ) >r 0 @ * ( R-R*box0 ) 3 @ + ( R-R*box0+r*box0 ) r> ( R-R*box0+r*box0 G-box0+g*box0 ) r> ( R-box0+r*box0 G-box0+g*box0 B-box0+b*box0 ) ; .3 0. 0. \ back ground 0. 0. 0. 1.0 box 0. 1. 0. 1.2 box 1. 1. 0. 1.4 box 0. 0. 1. 1.6 box 1. 0. 1. 1.8 box 0. 1. 1. 2.0 box 1. 1. 1. 2.2 box 1. .5 0. 2.4 box .5 .5 .5 2.6 box
rolling squares
陳爽
'24 May 19
: b ( i -- ) t * x .5 - over cos .25 * - abs .24 < y .5 - rot sin .25 * - abs .24 < * ; .2 b .4 b .6 b
Box going in a circle Redux
陳爽
'24 May 19
x .5 - t cos .25 * - abs .24 < y .5 - t sin .25 * - abs .24 < * dup dup
Box going in a circle Redux
陳爽
'24 May 19
: a t pi 2 * mod ; : x x .5 - a cos .25 * - ; : y y .5 - a sin .25 * - ; x abs .24 < y abs .24 < * dup dup
Box going in a circle Redux
陳爽
'24 May 19
: a t pi 2 * mod ; : anoc a not 0.25 + ; : cx 0.25 a cos * x + anoc ; : cy 0.25 a sin * y + anoc ; cx >= cy >= and cx - 0.5 <= cy - 0.5 <= and and dup dup
Box going in a circle
Uber
'24 May 19
\ fraction of time. The smaller the number (but bigger than zero), the more often the return : fr t swap mod ; \ The larger the number on the stack, the lower the return (in the range 0.0 and 1.0 -- 1.0 and 0.0 ) : rev 1 - abs ; \ The farther from 5 the number on the stack, the closer to 0.5 the return ( in the range 0.0 and 1.0 -- 0.0 and 0.5 ) : 0to5 0.5 - abs ; y 0to5 x 0to5 + fr dup dup
hypnosis reverse
Arsen
'24 May 19
\ fraction of time. The smaller the number (but bigger than zero), the more often the return : fr t swap mod ; \ The larger the number on the stack, the lower the return (in the range 0.0 and 1.0) : rev 1 - abs ; \ The farther from 5 the number on the stack, the closer to 0.5 the return ( on the stack in the range 0.0 and 1.0 -- ) : 0to5 0.5 - abs ; y 0to5 x 0to5 + rev fr dup dup
hypnosis
Arsen
'24 May 19
: c .5 - ; : x x c ; : y y c ; : λ x x * y y * + sqrt ; λ .31 < x abs .292 < y abs .292 < * x y - abs .4 < x y + abs .4 < * λ .48 <
square and circle
陳爽
'24 May 19
: n 2 ; : c 1 mod .5 - ; : d n * ; : x x d ; : ix x floor ; : x x c ; : y y d ; : iy y floor ; : y y c ; : | iy n * ix + = * ; : λ x x * y y * + sqrt ; λ .3 < 0 | x abs .050 < y abs .050 < + 3 | + x abs .292 < y abs .292 < * 1 | x abs .150 < y abs .150 < + 3 | + x y - abs .4 < x y + abs .4 < * 2 | x abs .250 < y abs .250 < + 3 | + λ .48 <
graphics Redux
陳爽
'24 May 19
: n 3 ; : c 1 mod .5 - ; : d n * ; : x x d ; : ix x floor ; : x x c ; : y y d ; : iy y floor ; : y y c ; : | iy n * ix + = * + ; : λ x 2 ** y 2 ** + sqrt ; : θ x y atan2 ; : n 0 @ ; : n! 0 ! ; : α pi 9 / ; \ half inner angle : a pi n / ; \ outer angle : β θ a 2 * mod a - abs ; : star ( r n -- star ) n! >r pi 9 / sin r> * pi 9 / cos β sin * β cos pi 9 / sin * + / λ > ; : polygon ( r n -- polygon ) n! >r pi 2 / sin r> * pi 2 / cos β sin * β cos pi 2 / sin * + / λ > ; x abs .45 < y abs .45 < * \ red 0 \ green λ .35 < 7 | x abs .292 < y abs .292 < * 0 | x y - abs .4 < x y + abs .4 < * 1 | .22 3 polygon 4 | .45 5 star 2 | .44 8 star 5 | .33 7 polygon 3 | .35 12 polygon 6 | .43 12 star 8 | 0 \ blue brightness x abs .49 < y abs .49 < * \ trasparency
graphics
陳爽
'24 May 19
: n 50 t sin 30 * + ; : x x t sin 12 / + ; : y y t sin 8 / + ; : a ( dy dx -- angle ) atan2 t sin 5 * + ; : r ( dy dx -- dist ) dup * swap dup * + sqrt ; : s ( x0 y0 n -- spiral ) >r y swap - swap x swap - ( y-y0 x-x0 ) 2dup r ( y-y0 x-x0 dist ) -rot a r@ / + ( dist+angle/n ) r> * ( (dist+angle/n)*n ) pi 2 * mod 1 < ; .500 .500 n s .500 .503 n s x * .503 .500 n s y *
spiral
陳爽
'24 May 19
Next