Re: modifying a program




"patrick_woflian" <gingercrock@xxxxxxxxxxx> wrote in message
news:1133294331.583577.230900@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> PROBLEM:
> 'Modify the game to allowe the user to specify the difficulty of the
> game as command line parameters:
>
> java HiLo nDicenSides
>
> EG java HiLo 2 6 would roll two six sided dice and add the results to
> give a number between one and twelve..
>
> after each game ask the user if they wish to play again.. store and
> display their best score over all the games..
>
>
> any ideas how to go about this?
>

Whenever I roll two six sided dice and add them together, I get a number
between two and twelve (as opposed to one and twelve).

If my memory serves, you're that person who was trying to write a game
in which a single 12 sided die was being rolled, correct? Well, assuming you
got that game working, I would first try to generalize it so that you could
roll dice with any number of sides. Once that works, I'd generalize again so
that any number of dice could be rolled.

- Oliver




.



Relevant Pages

  • looking for small cumulative dice roll calculator
    ... I'm playing a game where I need to make decisions based on 6 sided dice ... I'll be rolling different numbers of 6 sided dice, ... Often, I'll be presented with different goals in the game, so I'd like to ...
    (rec.games.board)
  • Re: [OT] Heroquest
    ... but a copy of the rules in English rather ... I found a version of StarQuest online, ... Instead of attempting to play the game as designed, The Yowlet has just taken out all the figurines and is playing a strange version of table top miniatures with them. ... He rolls the dice, announces what number he's rolled (we're mean and supplied a 20 sided dice, so he has to do 'big numbers' too), and then decides what that number means (although its not consistant. ...
    (rec.pets.cats.anecdotes)
  • Second question from interview
    ... You are gambling on the roll of a fair six sided dice, in this game if ...
    (rec.puzzles)
  • Re: Is the challenge part of the fun?
    ... more like a pyramid scheme. ... Life's a crap shoot and there only one way to get out of the game. ... I prefer 12 sided dice. ...
    (rec.music.classical.guitar)
  • Applet
    ... It is a game of craps and I am trying to warn the player if h/she ... // create button user clicks to roll dice ... displayMessage(); // display message indicating game status ... // roll dice, ...
    (comp.lang.java.programmer)