Page 1 of 1

Mandelbrot in text mode...

Posted: Sun Sep 11, 2022 2:49 pm
by jedie
I made a mandelbrot in BASIC for the text mode (Because my DragonPy Emulator support only the text mode)

Here the listing:

Code: Select all

10 GOTO 280
20 FOR Y=-8 TO 8
30 FOR X=-21 TO 10
40 CA=X*.1
50 CB=Y*.15
60 A=CA
70 B=CB
80 FOR I=0 TO 8
90 T=A*A-B*B+CA
100 B=2*A*B+CB
110 A=T
120 IF (A*A+B*B)>4 THEN GOTO 160
130 NEXT I
140 PRINT CHR$(128);
150 GOTO 170
160 PRINT CHR$(PEEK(&H4000+I));
170 NEXT X
180 NEXT Y
190 ' ...RESTART ENDLESS LOOP...
200 GOTO 20
210 ' Y=-8 TO 8 -> HEIGHT
220 ' X=-20 TO 10 -> WIDTH
230 ' CA=X*.1 -> ZOOM WIDTH
240 ' CB=Y*.15 -> ZOOM HEIGHT
250 ' I=0 TO 8 -> DEPTH==CHARS COUNT
260 '
270 ' INIT COLOR CHARACTERS:
280 FOR I=0 TO 8
290 READ CHARNO
300 PRINT "WRITE TO:";HEX$(&H4000+I);CHR$(CHARNO);CHARNO
310 POKE &H4000+I,CHARNO
320 NEXT I
330 GOTO 20
340 ' USED CHARACTERS:
350 DATA 128,175,191,143,223,239,159,255,207
(Also here: https://github.com/jedie/DragonPy/blob/ ... lbrot2.bas )

Looks like:
2022-09-11_15-41.png
2022-09-11_15-41.png (116.06 KiB) Viewed 6502 times
2022-09-11_15-42.png
2022-09-11_15-42.png (26.33 KiB) Viewed 6502 times

Re: Mandelbrot in text mode...

Posted: Sun Sep 11, 2022 3:19 pm
by robcfg
Hehe, nice!

I wonder how it would be using the SG24 semigraphics mode. The good thing about the semigraphics characters is that all color have a character with the other half of the character in black, and that you can change the color every line, which would be a nice increse in resolution while still on text mode :mrgreen: