home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C64'er
/
C64'er.iso
/
87xx
/
8709a.d64
/
hilbert
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-03-30
|
2KB
|
60 lines
10 REM ****************************
20 REM * HILBERT-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 SP=95/2^(GR):SE=95/2^(GR-1):XP=65+SP:YP=195-SP:W=0:R=1
120 :
130 SYS 50176,14,0:SYS 50179,1:SYS 50194:REM GRAFIK EIN
140 :
150 GOSUB 300: REM 'HILBERT' 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 * 'HILBERT' *
300 REM ***************************
310 :
320 IF GR=0 THEN RETURN
330 W=W-90*R: REM 'DREHE'
340 GR=GR-1:R=-R:GOSUB 300:R=-R: REM 'HILBERT'
350 S=SE:GOSUB 500: REM 'SCHREITE'
360 W=W+90*R: REM 'DREHE'
370 GOSUB 300: REM 'HILBERT'
380 S=SE:GOSUB 500: REM 'SCHREITE'
390 GOSUB 300: REM 'HILBERT'
400 W=W+90*R: REM 'DREHE'
410 S=SE:GOSUB 500: REM 'SCHREITE'
420 R=-R:GOSUB 300:R=-R:GR=GR+1: REM 'HILBERT'
430 W=W-90*R: REM 'DREHE'
440 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