var card, npctotal, npccard, total, num, cash, bet, intin : int
var input : string
cash := 10
procedure reset
total := 0
card := 0
npctotal := 0
num := 0
bet := 0
Draw.Box (10, 10, 80, 120, 255)
Draw.Box (90, 10, 160, 120, 255)
Draw.Box (10, 260, 80, 370, 255)
Draw.Box (90, 260, 160, 370, 255)
locate (19, 22)
put "Cards Total: ", total, "" ..
locate (20, 22)
put "Cash: $", cash
locate (21, 22)
put "Bet: $", bet
locate (25, 22)
put "[hit , stand , raise bet , lower bet]"
end reset
reset
loop
locate (23, 22)
put " "
locate (23, 22)
put "Command: " ..
get input : *
if input = "hit" then
randint (card, 1, 10)
total := total + card
num := num + 1
elsif input = "raise bet" then
locate (18, 40)
put ""
locate (18, 40)
put "By how much: " ..
get intin
if intin <= cash then
bet := bet + intin
cash := cash - intin
locate (18, 40)
put ""
locate (18, 40)
put "Bet raised up $", intin
else
locate (18, 40)
put ""
locate (18, 40)
put "You do not have $", intin, " to bet!"
end if
elsif input = "lower bet" then
locate (18, 40)
put ""
locate (18, 40)
put "By how much: " ..
get intin
if intin <= bet then
bet := bet - intin
cash := cash + intin
locate (18, 40)
put ""
locate (18, 40)
put "You take $", intin, " out of your bet."
else
locate (18, 40)
put ""
locate (18, 40)
put "You cant lower your bet more than ", bet
end if
end if
locate (19, 3)
put "Card: ", card, "" ..
locate (19, 22)
put "Cards Total: ", total, "" ..
locate (20, 22)
put "Cash: $", cash
locate (21, 22)
put "Bet: $", bet
%666666
locate (17 + num, 13)
put " " ..
locate (17 + num, 13)
put "Card: ", card, "" ..
%666666
end loop
|