
-----------------------------------
king202
Wed Apr 21, 2004 1:12 pm

Help Making a BlackJack Game
-----------------------------------
Hey
I need some help making a graphical Blackjack game. If someone can help me out I would be greatful

-----------------------------------
Cervantes
Wed Apr 21, 2004 2:37 pm


-----------------------------------
what do you mean by "help"?  How are you planning to do it and what exactly have you done so far?  We need more information in order to "help" you.  And if on the off chance you mean "do this for me" when you say "help" you won't get it.

So tell us what you need help with, and we will surely provide.

-----------------------------------
king202
Wed Apr 21, 2004 2:55 pm


-----------------------------------
OK I have a Blackjack game That just plays the game blackjack. I was woundering if you could help me make the bet part of it. 
I can seem to be able to place a bet and have the money either take away or addon to the total amount.
can you help

-----------------------------------
Dan
Wed Apr 21, 2004 5:18 pm


-----------------------------------
well u just have a var that holdes how much money they curenly have, then u get input from the users about how much money they whont to bet. if it is more then what they have or an invaled number u ask the qeustion intill they put in vaild input. then once the game is done u add or take away money from the 1st money var deponding on the value of the input of how much to bet. so if they start with 1000:

var money:int:=1000
vet bet:int

put "put in $ to bet"
get bet

%put some error checking here
%put game here


%if they lose the game:
money := money - bet

%else if they win the game

money := money + bet

-----------------------------------
gamer
Wed Apr 21, 2004 5:30 pm


-----------------------------------
if u want u may wish to post wut ur program is so far, then we can hav more understanding of ur game

-----------------------------------
king202
Wed Apr 21, 2004 9:54 pm


-----------------------------------
Ok here is my program can you please help me Set you the bet part

% BlackJack 

var card : int
var input : string
var plays : string
var total : int
var dealer : int
var dcard : int

loop
    total := Rand.Int (1, 10)
    loop 
        put total :2
        put "would you like to Hit or Stay?  "..
        get input
        if input = "H" or input = "h" then
            card := Rand.Int (1, 10)
        else
            exit
        end if
        total := card + total
        exit when total > 21
    end loop
    loop
        dealer := Rand.Int (1, 11)
        if dealer < 16 then
            dcard := Rand.Int (1, 11)
            dealer := dealer + dcard
        end if
        exit when dealer >= 16
    end loop
    put "The dealer has "
    delay (500)
    put dealer, "!"
    put "You have "
    delay (500)
    put total, "!"
    if total > 21 and dealer > 21 then
        put "You and the dealer busted!"
    elsif total > 21 then
        put "You busted, dealer wins!"
    elsif total = dealer then
        put "You and the dealer tied!"
    elsif total > dealer then
        put "You win!"
    elsif dealer > 21 then
        put "The dealer busted, you win!"
    else
        put "The dealer wins!"
    end if
end loop

-----------------------------------
gamer
Wed Apr 21, 2004 10:09 pm


-----------------------------------
is this wut ya want?
% BlackJack

var card, total, dealer, dcard, bet, money : int
var input, plays : string
money := 1000

loop
    total := Rand.Int (1, 10)
    put "You have $", money, "."
    loop
        put "How much would you like to bet for this game? $" ..
        get bet
        exit when bet > 0 or bet  21
    end loop
    loop
        dealer := Rand.Int (1, 11)
        if dealer < 16 then
            dcard := Rand.Int (1, 11)
            dealer := dealer + dcard
        end if
        exit when dealer >= 16
    end loop
    put "The dealer has "
    delay (500)
    put dealer, "!"
    put "You have "
    delay (500)
    put total, "!"
    if total > 21 and dealer > 21 then
        put "You and the dealer busted!"
        money -= bet
    elsif total > 21 then
        put "You busted, dealer wins!"
        money -= bet
    elsif total = dealer then
        put "You and the dealer tied!"
    elsif total > dealer then
        put "You win!"
    elsif dealer > 21 then
        put "The dealer busted, you win!"
        money += bet
    else
        put "The dealer wins!"
        money -= bet
    end if
    exit when money  0 or bet  21
    end loop
    loop
        randint (dealer, 1, 10)
        if dealer < 16 then
            randint (dcard,1,10)
            dealer := dealer + dcard
        end if
        exit when dealer >= 16
    end loop
    put "The dealer has "
    delay (500)
    put dealer, "!"
    put "You have "
    delay (500)
    put total, "!"
    if total > 21 and dealer > 21 then
        put "You and the dealer busted!"
        money -= bet
    elsif total > 21 then
        put "You busted, dealer wins!"
        money -= bet
    elsif total = dealer then
        put "You and the dealer tied!"
    elsif total > dealer then
        put "You win!"
        money +=bet
    elsif dealer > 21 then
        put "The dealer busted, you win!"
        money -=bet
    else
        put "The dealer wins!"
        money -= bet
    end if
    exit when money 