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

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




PostPosted: Thu May 25, 2006 2:38 pm   Post subject: Blackjack: wut you think?

Hey, I made a Blackjack game, and I was just wondering what other people think about it. Not all of the comments are on, but I've got some of them on there......

Here it is, all criticism is accepted, I need the advice.

THANKS!



Black Jack.zip
 Description:
Casino Blackjack by Tom Kempton

Download
 Filename:  Black Jack.zip
 Filesize:  147.53 KB
 Downloaded:  720 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
pavol




PostPosted: Thu May 25, 2006 4:42 pm   Post subject: (No subject)

that's a pretty good game.
you might want to think about using font for your instructions and such though. it'll make it look more appealing.
maiku




PostPosted: Thu May 25, 2006 4:44 pm   Post subject: (No subject)

Very Happy Thanks

I never thought of that, but you've got a point

Anyone else got any advice, I'm still open to it
Guest




PostPosted: Sun May 28, 2006 9:23 am   Post subject: (No subject)

i always thought of making a blackjack game, but i never got around to it. the coding would take too long for me, all the if statments..
TheOneTrueGod




PostPosted: Sun May 28, 2006 10:16 am   Post subject: (No subject)

Yarr, its not too bad, but coding can be way more simple. There are many, MANY card games on this site, but none of them seem to use effective coding... Instead of having a different if statement for each card, a la:

code:

if dlrCardNum (1) = 1 then
            Font.Draw ("A", 75, 420, fontID, FontColour)
            dlrPoints += 1
        elsif dlrCardNum (1) = 2 then
            Font.Draw ("2", 75, 420, fontID, FontColour)
            dlrPoints += 2
        elsif dlrCardNum (1) = 3 then
            Font.Draw ("3", 75, 420, fontID, FontColour)
            dlrPoints += 3
        elsif dlrCardNum (1) = 4 then
            Font.Draw ("4", 75, 420, fontID, FontColour)
            dlrPoints += 4
        elsif dlrCardNum (1) = 5 then
            Font.Draw ("5", 75, 420, fontID, FontColour)
            dlrPoints += 5
        elsif dlrCardNum (1) = 6 then
            Font.Draw ("6", 75, 420, fontID, FontColour)
            dlrPoints += 6
        elsif dlrCardNum (1) = 7 then
            Font.Draw ("7", 75, 420, fontID, FontColour)
            dlrPoints += 7
        elsif dlrCardNum (1) = 8 then
            Font.Draw ("8", 75, 420, fontID, FontColour)
            dlrPoints += 8
        elsif dlrCardNum (1) = 9 then
            Font.Draw ("9", 75, 420, fontID, FontColour)
            dlrPoints += 9
        elsif dlrCardNum (1) = 10 then
            Font.Draw ("10", 75, 420, fontID, FontColour)
            dlrPoints += 10
        elsif dlrCardNum (1) = 11 then
            Font.Draw ("J", 75, 420, fontID, FontColour)
            dlrPoints += 10
        elsif dlrCardNum (1) = 12 then
            Font.Draw ("Q", 75, 420, fontID, FontColour)
            dlrPoints += 10
        elsif dlrCardNum (1) = 13 then
            Font.Draw ("K", 75, 420, fontID, FontColour)
            dlrPoints += 10
        end if


You should instead do something like
code:

const cardName : array 0..12 of string := init("2","3","4","5","6","7","8","9","10","J","Q","K","A")

 Font.Draw (carName(dlrCardNum(1)), 75, 420, fontID, FontColour)
 dlrPoints += 10


And bam, you have MUCH more efficient code. (For the card numbers, I used the method I laid out in a couple of other posts, I.E. have the deck represented by an array from 0 to 51, card number is num mod 13, card suit is num div 13...)

The 0 to 51 method is, I believe, MUCH more efficient and MUCH less time consuming when working with games like, say, poker, over the conventional parallel array method.
maiku




PostPosted: Sun May 28, 2006 1:30 pm   Post subject: THANKS

Woaw... I never realized it could be done that way!

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  [ 6 Posts ]
Jump to:   


Style:  
Search: