Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Blackjack
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Tony_200004




PostPosted: Sat Jan 10, 2004 11:09 am   Post subject: Blackjack

well basicly i have a fairly good blackjack game going on right now but still got a few problems... cant post the code here becuase its for my isu but i will tell you what i can... basicly i have to make it so the dealer doesnt get more cards after he has 17... this is more complicating that it looks because a simple if dealer card>17 then hit type thing screws with the program. when you have this code added when it reaches the point with it, it resets the program
Sponsor
Sponsor
Sponsor
sponsor
shorthair




PostPosted: Sat Jan 10, 2004 12:19 pm   Post subject: (No subject)

My blackjack was fully graphical and complette , but you should still be able to use

if dealerhand is >=17 then
dealerhit := false
else
dealerhit :=true
end if

you will need to hit systems one for hte osuer and one for the computer
Tony_200004




PostPosted: Sat Jan 10, 2004 4:24 pm   Post subject: (No subject)

thanks i will try that... and could you just explain to me what the true and false stuff mean??
santabruzer




PostPosted: Sat Jan 10, 2004 4:28 pm   Post subject: (No subject)

it is a boolean variable..
basically it has two modes : true and false.. on or off.. 1 or 0... but here.. it's just true and false Razz
Tony_200004




PostPosted: Sat Jan 10, 2004 4:40 pm   Post subject: (No subject)

this is how i did it... work perfectly thank you so very much
code:

if card6 + card7 + card8 >= 17 then
                        card9 := 0
                    else
                        randint (card9, 1, 10)
                        card9 := card9
                    end if
shorthair




PostPosted: Sat Jan 10, 2004 4:57 pm   Post subject: (No subject)

looks good , im glad you got it
Tony




PostPosted: Sat Jan 10, 2004 5:20 pm   Post subject: (No subject)

now I would say that you have a 4/14 chance of getting a 10... but seeing as you just started with turing, I dont think it matters.

if you want to get ahead in CS, I sujest learning arrays, we have two tutorials available 8)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Tony_200004




PostPosted: Sun Jan 11, 2004 10:24 am   Post subject: (No subject)

I know my code is longer than it need because i am just using intergers not array but still im in a grade 10 turing basics class so he shouldn't care but i do want to learn the arrays... also it is due tomorrow so their is no time to change it.... i looked at the tutorials and i didnt understand them so can anyone please post a exaple program that does it for numbers... thanks
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: