File: spiral

package info (click to toggle)
brandy 1.23.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,268 kB
  • sloc: ansic: 39,421; makefile: 91; sh: 1
file content (29 lines) | stat: -rw-r--r-- 499 bytes parent folder | download | duplicates (3)
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
REM This program works either in the SDL build of Matrix Brandy, or
REM the full text mode version (tbrandy) when run from an xterm window.
:
SYS "Brandy_TekEnabled", 1, 100000
MODE 20
VDU5:CLG
R%=2500
H%=R%/2
REM rotated towards viewer by:
R=-PI/4
U=COS(R):V=SIN(R)
PROCP(4,0)
FORI%=1TOR%
PROCP(5,I%)
NEXT
VDU4
END
DEFPROCP(C%,S%)
T=PI*(S%-H%)/R%
C=COS(T)
X=COS(50*T)*C
Z=SIN(50*T)*C
Y=SIN(T)
W=Y*U+Z*V
Z=-Y*V+Z*U
Y=W
P=3500/(8-Z)
IFC%=4 THEN MOVE 640+X*P,512+Y*P ELSE DRAW 640+X*P,512+Y*P
ENDPROC