Rock, Paper, Scissors game (code included) (Sample Programs)

by robocos987 @, Saturday, November 12, 2011, 01:19 (2746 days ago) @ tfitz19

Added multiplayer to the game.
Code:
rem Multiplayer added by annonymous

start:
print "Write the first letter in caps!"
input "Singleplayer or Multiplayer? ",mode$
if mode$="Multiplayer" or mode$="multiplayer" then goto gamemult
if mode$="Singleplayer" then goto game

game:
input "Rock, Paper or Scissors? " , playerchoice$


compchoice = rand
print "You chose "+ playerchoice$
print
print
pause 2

if compchoice > 0 and compchoice < .33 then compchoice$ = "Rock"

if compchoice > .33 and compchoice < .66 then compchoice$ = "Scissors"

if compchoice > .66 and compchoice < 1 then compchoice$ = "Paper"


print "Computer chose " + compchoice$
print
print
pause 2

if compchoice$ = playerchoice$ then
print "Draw"
end
end if

if playerchoice$ = "Rock" and compchoice$ = "Scissors" then
print "You Win"
else
print "You Lose"
end
end if

if playerchoice$ = "Paper" and compchoice$ = "Rock" then
print "You Win"
else
print "You Lose"
end
end if

if playerchoice$ = "Scissors" and compchoice$ = "Paper" then
print "You Win"
else
print "You Lose"
end
end if


gamemult:
input "Player 1: Rock, Paper or Scissors? " , playerchoice$

print "Player 1 chose "+ playerchoice$
print
print
pause 2


input "Player 2: Rock, Paper or Scissors? " , playerchoice2$
print ""
print
pause 2


print "Player 2 chose "+ playerchoice2$
print
print
pause 2


if playerchoice2$ = playerchoice$ then
print "Draw"
end
end if

if playerchoice$ = "Rock" and playerchoice2$ = "Scissors" then
print "Player 1: You Win"
else
print "Player 2: You Lose"
end
end if

if playerchoice$ = "Paper" and playerchoice2$ = "Rock" then
print "Player 1: You Win"
else
print "Player 2: You Lose"
print
end
end if

if playerchoice$ = "Scissors" and playerchoice2$ = "Paper" then
print "Player 1: You Win"
else
print "Player 2: You Lose"
end
end if


Complete thread:

 RSS Feed of thread

powered by my little forum