Advertisement
Guest User

Rock, Paper, Scissors - C64 BASIC

a guest
Sep 3rd, 2021
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. 10 print chr$(147)
  2. 20 cpu=int(rnd(1)*3)+1:gosub 100
  3. 30 print"welcome to rock, paper, scissors. press:"
  4. 40 print"r for rock":print"p for paper":print"s for scissors":print""
  5. 45 print"press any other key to quit":print""
  6. 50 p$="":get p$:if p$="" then goto 50
  7. 60 if p$="r" then gosub 200
  8. 70 if p$="p" then gosub 300
  9. 80 if p$="s" then gosub 400
  10. 90 print"goodbye":end
  11. 100 if cpu=1 then c$="rock"
  12. 110 if cpu=2 then c$="paper"
  13. 120 if cpu=3 then c$="scissors"
  14. 130 return
  15. 200 print"you chose rock, i chose ";c$:print""
  16. 210 if c$="rock" then print"draw!"
  17. 220 if c$="paper" then print"you lose!"
  18. 230 if c$="scissors" then print"you win!"
  19. 240 gosub 500
  20. 300 print"you chose paper, i chose ";c$:print""
  21. 310 if c$="rock" then print"you win!"
  22. 320 if c$="paper" then print"draw!"
  23. 330 if c$="scissors" then print"you lose!"
  24. 340 gosub 500
  25. 400 print"you chose scissors, i chose ";c$:print""
  26. 410 if c$="rock" then print"you lose!"
  27. 420 if c$="paper" then print"you win!"
  28. 430 if c$="scissors" then print"draw!"
  29. 440 gosub 500
  30. 500 print""
  31. 501 print"thanks for playing"
  32. 505 print""
  33. 510 print"press y to play again"
  34. 520 q$="":get q$:if q$="" then goto 520
  35. 530 if q$="y" then goto 10
  36. 540 print"goodbye":end
  37. run
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement