Advertisement
felixnardella

Cannabis Curve

Aug 12th, 2022 (edited)
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. 5 rem 'cannabis curve' in basic v2 for commodore 64
  2. 10 rem implemented by felice nardella
  3. 15 t=ti
  4. 20 poke53280,15:s=8192
  5. 25 poke53272,peek(53272)or8:poke53265,peek(53265)or32
  6. 30 gosub200
  7. 35 rem clear color ram
  8. 40 cb$="pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp"
  9. 45 cb$=cb$+cb$:cb$=cb$+left$(cb$,121)
  10. 50 print"{clear}"cb$cb$cb$cb$;:print"ppp";:poke2023,16
  11. 55 tw(0)=1:fori=1to7:tw(i)=tw(i-1)*2:next
  12. 60 fori=1024to2023:pokei,208:next
  13. 65 goto95
  14. 70 rem plot x,y
  15. 75 p=s+320*int(y/8)+8*int(x/8)+(yand7)
  16. 80 pokep,peek(p)ortw(7-(xand7))
  17. 85 return
  18. 90 rem main
  19. 95 deffnc(t)=(1+.9*cos(8*t))*(1+.1*cos(24*t))*(.9+.05*cos(200*t))*(1+sin(t))
  20. 100 z=pi/2:fori=-pito-.5step.001
  21. 105 a=i-z:r=fn c(a):d=40*r:b=d*sin(i):c=d*cos(i)
  22. 110 x=160+b
  23. 115 y=170+c
  24. 120 gosub75: rem plot x,y
  25. 125 x=160-b
  26. 130 gosub75: rem plot x,y
  27. 135 next
  28. 140 rem end main
  29. 145 rem time calc
  30. 150 te=ti-t
  31. 155 rem wait for a key
  32. 160 poke198,0:wait198,1
  33. 165 gosub200
  34. 170 rem turn graphics off
  35. 175 printchr$(147)"elapsed time ="te/3600"min"
  36. 180 poke53265,peek(53265)and(223)
  37. 185 poke53272,21:poke53280,14
  38. 190 end
  39. 195 rem clear graphic ram
  40. 200 cb$=""
  41. 205 p1=peek(51):p2=peek(52)
  42. 210 poke51,64:poke52,63
  43. 215 forcn=1to125:cb$=cb$+chr$(0):next
  44. 220 poke51,p1:poke52,p2
  45. 225 return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement