![]() |
| | #1 |
| plzduntlakliekthiskthx Join Date: Oct 2002
Posts: 138
| My blackjack game is done! . Tell me what ya think! |
| o0obruceleeo0o is offline | |
| | #2 |
| plzduntlakliekthiskthx Join Date: Oct 2002
Posts: 138
| oh yeah! remember to maximize the console window and scroll all the way when you play |
| o0obruceleeo0o is offline | |
| | #3 |
| Pursuing knowledge Join Date: Jun 2002
Posts: 1,916
| I'm impressed.
__________________ Away. |
| confuted is offline | |
| | #4 |
| Pursuing knowledge Join Date: Jun 2002
Posts: 1,916
| you should clear "BLACKJACK!" off the screen after a new hand is dealt. I'm still impressed. edit: actually, there are a couple errors there. Check 'em out.
__________________ Away. Last edited by confuted; 06-08-2003 at 06:33 PM. |
| confuted is offline | |
| | #5 |
| plzduntlakliekthiskthx Join Date: Oct 2002
Posts: 138
| the only error I know of is that every once in a while it will take a while to deal out a card because it keeps trying to deal a card that is already there and the rand card keep getting already delt cards (ie there arent 2 ace of spades in a deck of cards ) |
| o0obruceleeo0o is offline | |
| | #6 | |
| Crazy Fool Join Date: Jan 2003 Location: Canada
Posts: 2,596
| Quote:
| |
| Perspective is offline | |
| | #7 |
| Cheesy Poofs! Join Date: Sep 2002 Location: Boulder
Posts: 1,728
| I like the graphics, good job! ![]() My only problem with it is that its played in a two player style instead of a casino style (player vs dealer) which is how it is usually played. It would be kind of cool if you allowed betting, doubling down, splitting etc. I looked at the code and I must say that there is a LOT of redundant code. Instead of having huge if statements for every card position drawn, couldn't you have it once? Since the only thing that changes is the x and y position drawn, all you would need to do is pass those variables to the function, something like this: Code: void drawCard(int xPos, int yPos)
{
//draw card at xPos and yPos;
}
int main()
{
// get first card
drawCard(0,0);
// get second card
drawCard(50,0);
// etc etc
}
Also, a real easy way to keep track of a deck of cards (and you don't want to use structs or objects) is to simply have an array of ints of size 52. To start off, deck[0]=0, deck[1]=1, deck[2]=2 etc. Then you have a function that shuffles the deck randomly like this: Code: for (int x=0; x<52; x++) swap deck[x] with deck[rand()%52]; |
| PJYelton is offline | |
| | #8 |
| plzduntlakliekthiskthx Join Date: Oct 2002
Posts: 138
| To be honest, after I realized the problems in my code I did not change it because I got lazy and bored of making the program lol. Right now I am in the part if my book where I start to learn some windows programming, so Im excited to make a game in windows... |
| o0obruceleeo0o is offline | |
| | #9 |
| Pursuing knowledge Join Date: Jun 2002
Posts: 1,916
| After the blackjack, it doesn't clear the text for the blackjack off the screen, and it doesn't show the new cards when you deal until the hand after the hand immediately after the blackjack.
__________________ Away. |
| confuted is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Simple Blackjack Program | saber1357 | C Programming | 1 | 03-28-2009 03:19 PM |
| 2D Game project requires extra C++ programmers, new or experienced | drallstars | Projects and Job Recruitment | 2 | 05-16-2007 10:46 AM |
| PC Game project requires c++ programmers | drallstars | Projects and Job Recruitment | 2 | 02-22-2006 12:23 AM |
| Game Engine Link Prob | swgh | Game Programming | 2 | 01-26-2006 12:14 AM |
| Game Programmer's AIM Circle: Join Today | KingZoolerius66 | A Brief History of Cprogramming.com | 28 | 12-20-2003 12:12 PM |