Rock-paper-scissors: Difference between revisions

No edit summary
Line 4,137:
# Email : <calmosoft@gmail.com>
 
see "
see "welcome to the game of rock-paper-scissors." + nl
see "each player guesses one of these three, and reveals it at the same time." + nl
see "rock blunts scissors, which cut paper, which wraps stone." + nl
see "if both players choose the same, it is a draw!" + nl
see "when you've had enough, choose q." + nl
g = list(3)
"
g = ["rock","paper","scissors"]
total=0 draw=0
pwin=0 cwin=0
draw=0
pwin=0
cwin=0
see "what is your move (press r, p, or s)?"
while true
Line 4,159 ⟶ 4,158:
total = total + 1
see"you chose " + g[gs] + " and i chose " + g[c] + nl
iftemp = (gs-c) = 0
if temp = 0
see ". it's a draw"
draw = draw + 1
ok
if (gs-c)temp = 1 or (gs-c)temp = -2
see ". you win!"
pwin = pwin + 1
ok
if (gs-c)temp = (-1) or (gs-c)temp = 2
see ". i win!"
cwin = cwin + 1
ok
end
 
func summarise()
see "you won " + pwin + ", and i won " + cwin + ". there were " + draw + " draws" + nl
see "thanks for playing!" + nl
</lang>
Output:
2,468

edits