26 lines
707 B
Text
26 lines
707 B
Text
numPlayers = 2
|
|
maxScore = 100
|
|
dim safeScore(numPlayers)
|
|
|
|
[loop]
|
|
for player = 1 to numPlayers
|
|
score = 0
|
|
|
|
while safeScore(player) < maxScore
|
|
input "Player ";player;" Rolling? (Y) ";rolling$
|
|
if upper$(rolling$) = "Y" then
|
|
rolled = int(rnd(0) * 5) + 1
|
|
print "Player ";player;" rolled ";rolled
|
|
if rolled = 1 then
|
|
print "Bust! you lose player ";player;" but still keep your previous score of ";safeScore(plater)
|
|
exit while
|
|
end if
|
|
score = score + rolled
|
|
else
|
|
safeScore(player) = safeScore(player) + score
|
|
end if
|
|
wend
|
|
next player
|
|
goto [loop]
|
|
[winner]
|
|
print "Player ";plater;" wins with a score of ";safeScore(player)
|