Advertisement
linesguy

sierpinski triangle in applesoft (Updated)

Jan 26th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. 0 rem updated feb 5 2017 with a significant speed boost
  2.  
  3. 5 x1 = 140 : x2 = 140 : dim P(280)
  4. 10 hgr2 : hcolor = 3
  5. 20 hplot 140,0
  6. 25 for Y = 0 to 138
  7. 30 for X = x1 to x2
  8. 40 if hscrn(X,Y) = 3 then P(X-1) = P(X-1) + 1 : P(X+1) = P(X+1) + 1
  9. 50 next
  10. 60 x1 = x1 - 1 : x2 = x2 + 1
  11. 70 for X = x1 to x2
  12. 80 if P(X) = 1 then hplot X,Y+1
  13. 90 P(X) = 0
  14. 100 next
  15. 110 next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement