Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Creating a Blackjack Game

843785Jul 10 2008 — edited Jul 11 2008
Hey yall (particularly flounder ;D),

Today, I have to create a simple, text-based Blackjack game. I haven't written any code for it yet, but I've begun making my plan in "simple english". Does this look right to you?

-Create an array for all 52 cards in a deck.
-Value each of the cards from 1-13 x 4 suits
-Create switch statements for the face cards, and make their values 10
-Create a switch statement for the aces (how do I make their values 1 or 11?)
-Create a loop system for drawing cards, which lets you draw another as long as you are under 21
-Dealer automatically wins if you go over
-Create a loop system for the dealer
-He will keep drawing as long as his value is under yours, but not over 21.
-Create a choice to play again.


I'm really new to Java, I've only been doing it for a few days or so, and I'm not sure what commands to use. In fact, I've never even made an array before (but I have been reading up on them as of today).

Thanks,
Apple Pie
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 8 2008
Added on Jul 10 2008
68 comments
1,972 views