Jump to content

Can Someone Help Me Please?


sanbs
 Share

Recommended Posts

Hello, I am having a little trouble with creating a Java code. I am very new at this and know very little about Java. The program is:Craps is a dice game played in casinos. Write a program to play a variation of the game as follows: roll 2 dice, each die has 6 faces representing values 1 through 6. Check the sum of the 2 dice and if sum = 2,3, or 12 you lose(aka craps). if sum = 7 or 11 you win(aka natural) and if sum is anything else, 4,5,6,8,9,or10 a point is established. Continue to roll the dice until either a 7 or the same point value is rolled. if 7 is rolled u lose, other wise you win.I know this has nothing to do with web design but any help with this will be greatly appreciated. Again I know very little about java so if you know about this please be very specific. Also the actual code just has to be displaying in text, nothing fancy. An example of what I mean is "You rolled 2 + 5 = 7. You win"-Thanks for any help.

Link to comment
Share on other sites

First, you're going to need a way to come up with two random numbers between 1 and 6.http://java.sun.com/j2se/1.5.0/docs/api/ja...til/Random.htmlThen, you're going to have to figure out how to write information to the console.http://java.sun.com/javase/6/docs/api/java...lang.Object...)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...