home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C64'er
/
C64'er.iso
/
87xx
/
8709a.d64
/
koch
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-03-30
|
1KB
|
58 lines
10 REM ****************************
20 REM * KOCH-KURVE *
30 REM ****************************
40 :
50 IF A=0 THEN A=1:LOAD "FRACTAL.OBJ"
60 :
70 OPEN 1,8,15,"U9":CLOSE 1: REM DIESE ZEEILE KANN BEI PROBLEMEN MIT DEM
80 REM FLOPPYSPEEDER WEGGELASSEN WERDEN!
90 POKE53280,0:POKE53281,0
100 INPUT "[147]GRAD ";GR
110 SE=300:XP=10:YP=125:W=0
120 :
130 SYS 50176,14,0:SYS 50179,1:SYS 50194:REM GRAFIK EIN
140 :
150 GOSUB 300: REM 'KOCH' AUFRUFEN
160 SYS 50185,0,0,319,0,1:SYS 50185,319,0,319,199,1
170 SYS 50185,319,199,0,199,1:SYS 50185,0,199,0,0,1
180 GET A$:IF A$="" GOTO 180
190 SYS 50179,0:IF A$="S" THEN GOSUB 700: REM 'GRAFIK SPEICHERN'
200 GOTO 60: REM NEUSTART
260 :
270 :
280 REM ***************************
290 REM * 'KOCH' *
300 REM ***************************
310 :
320 IF GR=0 THEN S=SE:GOSUB 500:RETURN: REM 'SCHREITE'
330 GR=GR-1:SE=SE/3
340 GOSUB 300: REM 'KOCH'
350 W=W-60: REM 'DREHE'
360 GOSUB 300: REM 'KOCH'
370 W=W+120: REM 'DREHE'
380 GOSUB 300: REM 'KOCH'
390 W=W-60: REM 'DREHE'
400 GOSUB 300: REM 'KOCH'
410 GR=GR+1:SE=SE*3
420 RETURN
450 :
460 :
470 REM ***************************
480 REM * 'SCHREITE' *
490 REM ***************************
500 :
510 XS=S*COS(W*(null)/180)
520 YS=S*SIN(W*(null)/180)
530 XP=XP+XS:YP=YP+YS
540 SYS 50185,XP-XS,YP-YS,XP,YP,1:REM LINIE
550 RETURN
650 :
660 :
670 REM ***************************
680 REM * 'GRAFIK SPEICHERN' *
690 REM ***************************
700 :
710 INPUT "GRAFIK-NAME ";N$
720 OPEN 2,8,2,"PI."+N$+",P,W":SYS 50191:CLOSE 2
730 RETURN