Код:
100 rem a basic, ascii mandelbrot
110 rem
120 rem this implementation copyright (c) 2019, gordon henderson
130 rem
140 rem permission to use/abuse anywhere for any purpose granted, but
150 rem it comes with no warranty whatsoever. good luck!
160 rem
165 rem bk conversion by litwr, 2020
170 rem c$ = ".,'~=+:;[/<&?oxOX# "
171 data ".", ",", "'", "~", "=", "+", ":", ";", "[", "/", "<", "&", "?", "o", "x", "O", "X", "#", " "
172 mi% = 19%
173 dim c$(mi%)
174 gosub 530
175 cls
180 so% = 1%
200 mx! = 4!
210 ls! = -2.0!
220 tp! = 1.25!
230 xs! = 2.5!
240 ys! = -2.5!
250 w% = 38%
260 h% = 21%
270 sx! = xs! / w%
280 sy! = ys! / h%
290 poke &O177712,&O162
300 for y% = 0% to h%
310 cy! = y% * sy! + tp!
320 for x% = 0% to w%
330 cx! = x% * sx! + ls!
340 zx! = 0!
350 zy! = 0!
360 cc% = 0%
370 x2! = zx! * zx!
380 y2! = zy! * zy!
390 if cc% >= mi% then goto 465
400 if (x2! + y2!) > mx! then goto 465
410 t! = x2! - y2! + cx!
420 zy! = 2! * zx! * zy! + cy!
430 zx! = t!
440 cc% = cc% + 1%
450 goto 370
460 rem ? mid$(c$, cc% - so%, 1%);
465 ? c$(cc%);
470 next x%
480 print
490 next y%
510 t = peek(&O177710)
512 if t<0 then t=-t else t=65536-t
514 print (t+65536)*64/3000*128/1000
520 end
530 restore
540 for i% = 1% to mi%
550 read c$(i%)
560 next i%
570 return