Advertisement
Guest User

Untitled

a guest
May 26th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. INDOWTITLE "Mandelbrot! v2.0 Demonstration by Robert Smith"
  2.  
  3. DIM x AS DOUBLE
  4. DIM y AS DOUBLE
  5. DIM cx AS DOUBLE
  6. DIM cy AS DOUBLE
  7. DIM zx AS DOUBLE
  8. DIM zy AS DOUBLE
  9. SCREEN 20,32
  10. PRINT "Mandelbrot! v2.0 Demonstration"
  11. PRINT "by Robert Smith"
  12. PRINT "Press enter to begin."
  13. input DEMO$
  14. CLS
  15. FOR p = 1 TO 20
  16. FOR v = 0 TO 767
  17. FOR h = 0 TO 1024
  18. x = 0
  19. y = 0
  20. cx = (h - (1023 / 2)+175)/(1023/3)
  21. cy = (v - (767 / 2))/(767/3)
  22. FOR I = 1 TO p
  23.   zx = x ^ 2 - y ^ 2 - cx
  24.   zy = 2 * x * y - cy
  25.   x = zx
  26.   y = zy
  27. IF (zx ^ 2 + zy ^ 2) ^ .5 > 2 THEN I = p
  28. NEXT I
  29. IF (zx ^ 2 + zy ^ 2) ^ .5 <= 2 THEN
  30. PSET (1023 - h, 767 - v), rgb(12*p,4*p,0)
  31. ENDIF
  32.  
  33. NEXT h
  34. NEXT v
  35. NEXT p
  36. LOCATE 1, 1
  37. Print "Mandelbrot demonstration complete! (press enter)"
  38. input abc$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement