Category : Science and Education
Archive   : BIOMORPH.ZIP
Filename : BIOMORPH.BAS

 
Output of file : BIOMORPH.BAS contained in archive : BIOMORPH.ZIP
DEF fna (r, i, c) = r * (r * r - 3 * i * i) + c
DEF fnb (r, i, c) = i * (3 * r * r - i * i) + c
DEF fnc (r, i, c) = r * r * (r * r * r - 3 * i * i * (r + 1)) + i * i * (5 * r * i * i - 4 * r * r * r) + c
DEF fnd (r, i, c) = i * i * i * i * i + r * i * (5 * r * r * r - 7 * r * i * i) + c

wide = 320
high = 200
shades = 16

scrm:
CLS
LOCATE 4, 1
PRINT "(1) CGA 320 X 200 4 colors"
PRINT : PRINT "(2) EGA 320 x 200 16 colors"
PRINT : PRINT "(3) EGA 640 x 350 16 colors"
PRINT : PRINT "(4) VGA 640 x 480 16 colors"
LOCATE 1, 1: INPUT "Choose a screen display (1-4) ", disp

LOCATE 15, 1
PRINT "(1) Z^3"
PRINT : PRINT "(2) Z^5"
PRINT : INPUT "Choose a formula (1-2) ", model

CLS
INPUT "real seed(0-3)", cnst
PRINT : INPUT "imaginary seed(0-3)", cnsti
PRINT : INPUT "left limit (xmin)", xmin%
PRINT : INPUT "right limit (xmax)", xmax%
PRINT : INPUT "top limit (ymin)", ymin%
PRINT : INPUT "bottom limit (ymax)", ymax%

SELECT CASE disp

CASE 1
shades = 4
SCREEN 1

CASE 2
SCREEN 7

CASE 3
SCREEN 9
wide = 640
high = 350

CASE 4
wide = 640
high = 480
SCREEN 12

CASE ELSE
SCREEN 1
shades = 4
END SELECT


FOR j% = 1 TO wide
IF INKEY$ <> "" THEN EXIT FOR
FOR k% = 1 TO high
z = xmin% + (xmax% - xmin%) / wide * j%
zi = ymin% + (ymax% - ymin%) / high * k%
modl:
SELECT CASE model

CASE 1
FOR n% = 1 TO shades OR 10
zn = fna(z, zi, cnst)
zni = fnb(z, zi, cnsti)
IF ABS(zn) > 10 OR ABS(zni) > 10 OR ABS(zn * zn + zni * zni) > 100 THEN : clor = n% MOD shades: EXIT FOR
z = zn
zi = zni
NEXT

CASE 2
FOR n% = 1 TO shades OR 10
zn = fnc(z, zi, cnst)
zni = fnd(z, zi, cnsti)
IF ABS(zn) > 10 OR ABS(zni) > 10 OR ABS(zn * zn + zni * zni) > 100 THEN : clor = n% MOD shades: EXIT FOR
z = zn
zi = zni
NEXT
CASE ELSE
model = 1
GOTO modl
END SELECT
IF ABS(zn) > 10 AND ABS(zni) > 10 THEN PSET (j%, k%), clor
NEXT
NEXT

hang1:
IF INKEY$ = "" THEN GOTO hang1

FOR i = 1 TO 9
LINE (0, i * high / 10)-(wide, i * high / 10)
LINE (i * wide / 10, 0)-(i * wide / 10, high)
NEXT
LOCATE 1, 1
PRINT "Cent X,Y:"; (xmax% + xmin%) / 2; (ymax% + ymin%) / 2; "X step:"; (xmax% - xmin%) / 10; "Y step:"; (ymax% - ymin%) / 10

hang2:
IF INKEY$ = "" THEN GOTO hang2



  3 Responses to “Category : Science and Education
Archive   : BIOMORPH.ZIP
Filename : BIOMORPH.BAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/