Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 11-15-2008, 12:27 AM   #11
Golden Master
 
freestyler105's Avatar
 
Join Date: Sep 2006
Posts: 7,883
Default Re: Java help

Blackjack wouldn't be too hard, that's a pretty good idea. Use arrays for the cards, write the program using methods, and throw in some while or for loops and you have a decent program using a bunch of concepts.
__________________

__________________
C2D E6600 | 4GB DDR2-800 | 9800GTX+ | Asus P5B-E | 150GB Raptor | 320GB 7200.10 | 750W Xigmatek PSU
freestyler105 is offline   Reply With Quote
Old 11-15-2008, 10:25 AM   #12
Site Team
 
celegorm's Avatar
 
Join Date: Sep 2006
Posts: 10,713
Send a message via AIM to celegorm
Default Re: Java help

Yeah, assuming you've used arrays before this should be very easy. Use dual arrays so you have the card in one part of the array, and a boolean for weather ro not it was delt so you don't get duplicate cards.

Out of curiosity, what compiler are you using?
__________________

__________________
"as a fanboy i refuse to admit it and will pull countless things out of my butt to disprove it"

Team Thelegorm! Total Kills: 21 (i iz in uor profile, editsing your sigz)
celegorm is offline   Reply With Quote
Old 11-16-2008, 02:44 PM   #13
88
Fully Optimized
 
88's Avatar
 
Join Date: May 2005
Posts: 4,775
Send a message via MSN to 88
Default Re: Java help

Quote:
Originally Posted by JogaBonito1502 View Post
How's the Black Jack game working? I was on the brink of creating a better version of FreeCell today...then I started playing it.
I got a small start on it. What's slowing me down is that I am learning Java while I'm writing the program. I really wish I could just write it in C++ (but my prof says no). I haven't touched the program since Wednesday. I've just been busy with other things.

Quote:
Originally Posted by freestyler105 View Post
Blackjack wouldn't be too hard, that's a pretty good idea. Use arrays for the cards, write the program using methods, and throw in some while or for loops and you have a decent program using a bunch of concepts.
Thanks, I'm liking it so far. I'm starting to see a few of the challenges involved but I should hopefully be able to work around them.

Quote:
Originally Posted by celegorm View Post
Yeah, assuming you've used arrays before this should be very easy. Use dual arrays so you have the card in one part of the array, and a boolean for weather ro not it was delt so you don't get duplicate cards.

Out of curiosity, what compiler are you using?
when you say dual arrays are you speaking of 2-dimensional arrays or 2 separate regular arrays?

I'm using Java JDK 6 as my compiler.
__________________
Killing under the cloak of war is no different than murder

Kein Alkohol ist auch keine Lsung!
88 is offline   Reply With Quote
Old 11-16-2008, 02:47 PM   #14
Guru
 
JogaBonito1502's Avatar
 
Join Date: Jan 2008
Location: U.S.
Posts: 7,841
Default Re: Java help

Quote:
Originally Posted by 88 View Post
you say dual arrays are you speaking of 2-dimensional arrays or 2 separate regular arrays?
I think he means a 2 dimensional array. I hate dealing with those. See if you can make a class and have an single dimensional array that uses a variable defined by that class. I could prove more effective if you need to associate more things with each card.
JogaBonito1502 is offline   Reply With Quote
Old 11-30-2008, 05:16 PM   #15
88
Fully Optimized
 
88's Avatar
 
Join Date: May 2005
Posts: 4,775
Send a message via MSN to 88
Default Re: Java help

Finally!! I finished my black jack game! LOL for the 3 weeks I had to program it I only managed to find time to work on it for 3-4 days but I got it done today! I have to hand it in tomorrow.

The only problem I wasn't able to fix was that every time the player wins, it says "YOU WIN" indicating a win but it also says "A DRAW" meaning there was a draw at the same time... It doesn't affect anything else but i just can't pinpoint why it's declaring both. (if statements look ok to me so idk...)
__________________
Killing under the cloak of war is no different than murder

Kein Alkohol ist auch keine Lsung!
88 is offline   Reply With Quote
Old 11-30-2008, 05:18 PM   #16
Guru
 
JogaBonito1502's Avatar
 
Join Date: Jan 2008
Location: U.S.
Posts: 7,841
Default Re: Java help

Check your brackets and your comparison signs (>, <, ==, etc).
JogaBonito1502 is offline   Reply With Quote
Old 12-01-2008, 01:57 AM   #17
88
Fully Optimized
 
88's Avatar
 
Join Date: May 2005
Posts: 4,775
Send a message via MSN to 88
Default Re: Java help

I'm sure i can track down where the problem is and I probably will but unfortunately not before I submit it. I had too many other things to worry about finishing so i couldn't get around to fixing the problem. It's minor, and the programming portion of this project is only worth 25% of the total mark.
__________________

__________________
Killing under the cloak of war is no different than murder

Kein Alkohol ist auch keine Lsung!
88 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 02:41 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0