This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

dice game  RSS feed

 
Stephen Foy
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Could someone give me some feedback on how to improve this, and of silly things ive done?

 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A neat exercise is to write out the simplest description of the game you can think of, then try to make the code look like that. I don't know if I have the rules quite right but it might look something like:

If the rules look right, see if you can make the core of your program have almost exactly that many lines and say almost exactly those rules to the reader. The other methods like getBestOfThreeThrows() should be easy to build out of the code you already have.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!