mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-01 05:31:52 +00:00
fractals: add basic fractal
This commit is contained in:
parent
bc120596bb
commit
45ea1efb66
35
basic/fractals/Makefile
Normal file
35
basic/fractals/Makefile
Normal file
@ -0,0 +1,35 @@
|
||||
include ../../Makefile.inc
|
||||
|
||||
DOS33 = ../../utils/dos33fs-utils/dos33
|
||||
TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft
|
||||
EMPTY_DISK = ../../empty_disk/empty.dsk
|
||||
|
||||
all: fractal.dsk
|
||||
|
||||
fractal.dsk: HELLO DRAGON.BAS DRAGON_SMALL.BAS
|
||||
cp $(EMPTY_DISK) fractal.dsk
|
||||
$(DOS33) -y fractal.dsk SAVE A HELLO
|
||||
$(DOS33) -y fractal.dsk SAVE A DRAGON.BAS
|
||||
$(DOS33) -y fractal.dsk SAVE A DRAGON_SMALL.BAS
|
||||
|
||||
####
|
||||
|
||||
HELLO: hello.bas
|
||||
$(TOKENIZE) < hello.bas > HELLO
|
||||
|
||||
####
|
||||
|
||||
DRAGON.BAS: dragon.bas
|
||||
$(TOKENIZE) < dragon.bas > DRAGON.BAS
|
||||
|
||||
####
|
||||
|
||||
DRAGON_SMALL.BAS: dragon_small.bas
|
||||
$(TOKENIZE) < dragon_small.bas > DRAGON_SMALL.BAS
|
||||
|
||||
|
||||
####
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.lst HELLO CUBE.BAS CHEAT.BAS
|
||||
|
19
basic/fractals/dragon.bas
Normal file
19
basic/fractals/dragon.bas
Normal file
@ -0,0 +1,19 @@
|
||||
4 REM POSTED TO TWITTER BY 8-BIT FRACTALS
|
||||
10 DIM S(30)
|
||||
20 HGR2:HCOLOR=7
|
||||
30 X=107:Y=142
|
||||
40 H=0:V=6
|
||||
50 S(0)=9:S(1)=1:SP=2
|
||||
60 GOSUB 80
|
||||
70 END
|
||||
80 SP=SP-2:N=S(SP):A=S(SP+1)
|
||||
90 IF N=0 THEN XX=X+H:YY=Y-V:HPLOT X,Y TO XX,YY:X=XX:Y=YY:RETURN
|
||||
100 S(SP)=N-1:S(SP+1)=-1
|
||||
110 S(SP+2)=A
|
||||
120 S(SP+3)=N-1:S(SP+4)=1
|
||||
130 SP=SP+5
|
||||
140 GOSUB 80:GOSUB 160:GOSUB 80
|
||||
150 RETURN
|
||||
160 SP=SP-1:A=S(SP)
|
||||
170 T=-A*H:H=A*V:V=T
|
||||
180 RETURN
|
4
basic/fractals/dragon_small.bas
Normal file
4
basic/fractals/dragon_small.bas
Normal file
@ -0,0 +1,4 @@
|
||||
0DIMS(30):HGR2:X=107:Y=142:V=6:S(0)=9:S(1)=1:P=2:GOSUB1:END
|
||||
1P=P-2:N=S(P):A=S(P+1):IFN=0THENU=X+H:W=Y-V:HPLOT X,YTOU,W:X=U:Y=W:RETURN
|
||||
2S(P)=N-1:S(P+1)=-1:S(P+2)=A:S(P+3)=N-1:S(P+4)=1:P=P+5:GOSUB1:GOSUB3:GOSUB 1:RETURN
|
||||
3P=P-1:A=S(P):T=-A*H:H=A*V:V=T:RETURN
|
2
basic/fractals/hello.bas
Normal file
2
basic/fractals/hello.bas
Normal file
@ -0,0 +1,2 @@
|
||||
5 HOME
|
||||
10 PRINT CHR$(4);"CATALOG"
|
Loading…
Reference in New Issue
Block a user