wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Random cards Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Random cards" Watch "Random cards" New topic
Author

Random cards

Paul Hambleton
Greenhorn

Joined: Jul 23, 2012
Posts: 2
Hello.

I have a very basic understanding of java and have been asked to write a simple program to generate 6 random playing cards cards and print out what they are? I am not sure how i should approach this, could i get some advice please as i have no clue where to start.

Thanks in advance.
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4442
    
    5

Hi Paul,

Welcome to the Ranch!

We encourage community members to SearchFirst (<--click) then come back with specific questions. You might try to google for "shuffle and deal cards in java".


Junilu - [How to Ask Questions] [How to Answer Questions]
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

A basic programming rule is to break your requirements down into smaller parts, and implement each of the parts separately as far as possible.

Now, in your case your requirements contain the word "and" right in the middle. This suggests an obvious division of the requirements into two parts. So, now you have two smaller tasks. Pick one and get started on it.
Paul Hambleton
Greenhorn

Joined: Jul 23, 2012
Posts: 2
Thank you for your advice thus far, appreciate your time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Random cards
 
Similar Threads
scratch card generating codes
shuffling
cards
Selection Sort?
Assigning random numbers to an array