Advertisement
Shaun_B

10 PRINT Racer by 8 Bit Show and Tell [Commodore PET]

Apr 7th, 2020
4,324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 1o=1:q=37:b=32:r$="":w=205.5:c=75:e$="4":w$="6":u=35:y=25:g=4:h=6:i=10:hs=2
  2. 5forx=otoc:m$=CHR$(w+RND(.)):r$=r$+m$:NEXT
  3. 10printchr$(147):c=20:r=13:w=15:d=.:s=32768:a=s+c:l=.:forz=.toostep.:x=RND(.)*i
  4. 20ifx<gthenr=r-o:ifr<othenr=o
  5. 30ifx>hthenr=r+o:ifr+w>qthenr=q-w
  6. 40rn=RND(.)*u+o:printmid$(r$,rn,r)spc(w)mid$(r$,rn,39-r-w)
  7. 50d=d+o:l=l+o:ifl>49thenl=.:w=w-o:ifw<3thenw=3
  8. 60ifd<ythennext
  9. 70geta$:on-(a$<>e$anda$<>w$)goto80:c=c+(a$=e$)-(a$=w$)
  10. 80a=s+c:p=PEEK(a):ifp=bthenpokea,42:NEXT
  11. 200printspc(17)"crash!":ifd>hsthenhs=d
  12. 205print,"score:"d"  high:"hs:forx=1to2000:NEXT:poke158,.:wait158,o:goto10
  13.  
  14. REM see https://youtu.be/bCTrdVhjjWo FOR details - some further optimisations
  15. REM are possible. This version by Donkeysoft, thanks TO 8 bit show AND tell
  16. REM FOR the original version. c= rulez!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement