Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INDOWTITLE "Mandelbrot! v2.0 Demonstration by Robert Smith"
- DIM x AS DOUBLE
- DIM y AS DOUBLE
- DIM cx AS DOUBLE
- DIM cy AS DOUBLE
- DIM zx AS DOUBLE
- DIM zy AS DOUBLE
- SCREEN 20,32
- PRINT "Mandelbrot! v2.0 Demonstration"
- PRINT "by Robert Smith"
- PRINT "Press enter to begin."
- input DEMO$
- CLS
- FOR p = 1 TO 20
- FOR v = 0 TO 767
- FOR h = 0 TO 1024
- x = 0
- y = 0
- cx = (h - (1023 / 2)+175)/(1023/3)
- cy = (v - (767 / 2))/(767/3)
- FOR I = 1 TO p
- zx = x ^ 2 - y ^ 2 - cx
- zy = 2 * x * y - cy
- x = zx
- y = zy
- IF (zx ^ 2 + zy ^ 2) ^ .5 > 2 THEN I = p
- NEXT I
- IF (zx ^ 2 + zy ^ 2) ^ .5 <= 2 THEN
- PSET (1023 - h, 767 - v), rgb(12*p,4*p,0)
- ENDIF
- NEXT h
- NEXT v
- NEXT p
- LOCATE 1, 1
- Print "Mandelbrot demonstration complete! (press enter)"
- input abc$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement