Blackjack: wut you think?
Author |
Message |
maiku
![](http://myspace-651.vo.llnwd.net/01288/15/60/1288390651_m.jpg)
|
Posted: 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!
Description: |
Casino Blackjack by Tom Kempton |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
Black Jack.zip |
Filesize: |
147.53 KB |
Downloaded: |
725 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
pavol
|
Posted: 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.
|
|
|
|
|
![](images/spacer.gif) |
maiku
![](http://myspace-651.vo.llnwd.net/01288/15/60/1288390651_m.jpg)
|
Posted: Thu May 25, 2006 4:44 pm Post subject: (No subject) |
|
|
Thanks
I never thought of that, but you've got a point
Anyone else got any advice, I'm still open to it
|
|
|
|
|
![](images/spacer.gif) |
Guest
|
Posted: 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..
|
|
|
|
|
![](images/spacer.gif) |
TheOneTrueGod
![](http://www.drmcninja.com/images/mcninjab3.jpg)
|
Posted: 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.
|
|
|
|
|
![](images/spacer.gif) |
maiku
![](http://myspace-651.vo.llnwd.net/01288/15/60/1288390651_m.jpg)
|
Posted: Sun May 28, 2006 1:30 pm Post subject: THANKS |
|
|
Woaw... I never realized it could be done that way!
Thanks!
|
|
|
|
|
![](images/spacer.gif) |
|
|