-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwaves.dc
47 lines (42 loc) · 852 Bytes
/
waves.dc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
80 const WIDTH
24 const HEIGHT
1 WIDTH / const INV_WIDTH
1 HEIGHT / const INV_HEIGHT
WIDTH HEIGHT * const AREA
HEIGHT 2 / const HIGHROW
WIDTH 2 / const HIGHCOL
HIGHROW -1 * const LOWROW
HIGHCOL -1 * const LOWCOL
var mybuf
AREA mkbuf
mybuf !
: bufadd
over mybuf @ + swap 1 memset drop
;
: waves
4096 times
0
HIGHROW LOWROW 1 for
HIGHCOL LOWCOL 1 for
i INV_WIDTH * dup * sin
j INV_HEIGHT * dup * cos
* sqrt
k
*
sin
0.5
<
if 32 else 42 endif bufadd
1 + # increment the original 0 counter
next
next
mybuf @ AREA + 0 1 memset drop
mybuf @ print
0.0384 sleep
drop
again
;
waves
cr
"DONE!!!!!!" print
cr