sanbs Posted June 3, 2009 Share Posted June 3, 2009 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 More sharing options...
jesh Posted June 3, 2009 Share Posted June 3, 2009 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 More sharing options...
sanbs Posted June 5, 2009 Author Share Posted June 5, 2009 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...) Thanks, those links were very helpful. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.