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)
  • Second question from interview
    ... You are gambling on the roll of a fair six sided dice, in this game if ...
    (rec.puzzles)
  • 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)
  • Game Review: Griddle! "Its Game Time, Lets Roll!"
    ... the amount of dice one would roll in a Axis & Allies ... Rolling dice is the heart of the game with some ... If you did not have control of a Gridder, ...
    (rec.games.board)
  • Re: [Rant] Why the hell cant I make a die roll to save my life?
    ... for rolling retardedly well in Battletech, ... game where I headcapped two assault mechs in my first two shots of the ... down every die roll for a game or two you aren't that bad. ... random army tend to suck rabid monkey nuts. ...
    (rec.games.miniatures.warhammer)