Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

dice game

 
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