loop
var a, b : int
var p1, p2, pa : string
put "player one enter your name"
get p1
put "player two enter your name"
get p2
randint (a,1,6)
randint (b,1,6)
if p1 = "bob" then
randint (a, b + 1, 6)
else
randint (a, 1, 5)
end if
if p2 = "bob" then
randint (b, a + 1, 6)
else
randint (b, 1, 5)
end if
put p1, " rolled a ", a, " vs. ", p2, " rolled a ", b
if a < b then
put p2, " wins"
elsif a > b then
put p1, " wins"
else
put "tie"
end if
put "play again (y)es or (n)o?"
get pa
if pa = "y" then
cls
else
exit when pa = "n"
end if
end loop
|