Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
need help with blackjack program
Author Message
old_School1616

Posted: Wed Jun 04, 2003 9:26 am   Post subject: need help with blackjack program

I need graphics for blackjack program ex: the cards of the dealer and player one, I have movar games, win1, win2, card1, card2, card3, card4, card5, card6, total, total1, num1, num2, num3, num4, num5, num6, pot1, bet : int
games := 0
win1 := 0
win2 := 0
pot1 := 100
loop
cls
put "How much would you like to bet? "
get bet
games := games + 1
randint (num1, 1, 11)
card1 := num1
randint (num2, 1, 11)
card2 := num2
total := card1 + card2
exit when total>21
put "Player 1's cards ", card1, " and ", card2
loop

put "Do you want another card? (y/n)"

randint (num3, 1, 11)
card3 := num3
total := total + num3
put ""
put "The card is ", card3
put "Player 1's total is ", total
end if
exit when total > 21
end loop
put ""

randint (num4, 1, 11)
card4 := num4
randint (num5, 1, 11)

card5 := num5
total1 := card4 + card5
put ""
put "Dealers cards are ", card4, " and ", card5
loop
if total1 < 17 then
randint (num6, 1, 11)
card6 := num6
total1 := total1 + num6
put ""
put "The card is ", card6
put "Dealers total is ", total1
end if
exit when total1 > 16
end loop
put ""
if total < total1 and total1 <= 21 then
put "Dealer has won"
put "You have lost ", bet, " dollars"
pot1 := pot1 - bet
put " The amount is now ", pot1 , " dollars"
win2 := win2 + 1
elsif total1 < total and total <= 21 then
put "Player 1 has won"
put " You have gained ", bet, " dollars"
pot1 := pot1 + bet
put " The amount is now ", pot1 , " dollars"
win1 := win1 + 1

elsif total <= 21 and total1 > 21 then
put "Player 1 has won"
put " You have gained ", bet, " dollars"
pot1 := pot1 + bet
put " The amount is now ", pot1, " dollars"
win1 := win1 + 1
elsif total1 <= 21 and total > 21 then
put " Dealer has won"
put " You have lost ", bet, " dollars"
pot1 := pot1 - bet
put " The amount is now ", pot1, " dollars"
win2 := win2 + 1
elsif total = total1 then
put " Dealer has won"
put " You have lost ", bet, " dollar"
pot1 := pot1 - bet
put " The amount is now ", pot1, " dollars"
end if
put ""
put " Number Of ", games, " games played, Dealer ", win2, " and Player 1 has ", win1
put ""
put "Would you like to play again? (y/n)"
end loop
st of the code done just not the graphics

Tony

Posted: Wed Jun 04, 2003 9:27 am   Post subject: (No subject)

then just use Pic.Draw
Tony's programming blog. DWITE - a programming contest.
JSBN

Posted: Wed Jun 04, 2003 11:52 am   Post subject: (No subject)

Asok..... sound familiar?
lol, yea, what you could try is have an if statement, or whatever of cards and their pictrues and call'em when u need em.
Asok

Posted: Wed Jun 04, 2003 11:54 am   Post subject: (No subject)

old_School1616

Posted: Wed Jun 04, 2003 6:43 pm   Post subject: (No subject)

You think someone could give me a website with the code for the graphics for blackjack or give me the code it self, cause this program is really really pissing me off I've pretty much tried everything
Tony

Posted: Wed Jun 04, 2003 7:56 pm   Post subject: (No subject)

 code: var cardID1 : int := Pic.FileNew("card1.jpg") Pic.Draw(cardID1,x,y,picCopy)

is this what you're looking for?
Tony's programming blog. DWITE - a programming contest.
old_School1616

Posted: Thu Jun 05, 2003 9:42 am   Post subject: (No subject)

how would you input string's or varables with drawin picture inside turing.

 code: drawbox (100,340,200,200,7)

how would I place a text/numbers with inside this box?
Prince

Posted: Thu Jun 05, 2003 10:03 am   Post subject: (No subject)

y not jus draw the cards out line by line (takes forever but gets the job done).. thats how i did it

tum_twish

Posted: Thu Jun 05, 2003 10:59 am   Post subject: (No subject)

there are chr values for the suits
if u wanna make ur own
old_School1616

Posted: Thu Jun 05, 2003 2:25 pm   Post subject: (No subject)

ok I'm newb and I have no clue what you people are talking about I have my box but I need to get a number inside of it, so I'm asking how do you put the number inside of my box?

Posted: Thu Jun 05, 2003 3:41 pm   Post subject: (No subject)

I don't think the chr's exist for the suits in Turing 4

but in 3 you could have done
put chr (3) %hearts
put chr (4) %diamonds
put chr (5) %clubs

and I don't know where the spade is... I am not sure that it exists :/
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 11 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: