Re: modifying a program
- From: "Hal Rosser" <hmrosser@xxxxxxxxxxxxx>
- Date: Tue, 29 Nov 2005 16:54:33 -0500
"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?
The command line parameters he speaks of is handled in the main easily.
That's what the (String [] args) arguments are all about.
args[0] would have a value of "6" in the example you gave, and args[1] would
be "6".
Keep in mind these are strings.
That should be enough without writing the code for you, which your professor
wouldn't want us to do.
.
- References:
- modifying a program
- From: patrick_woflian
- modifying a program
- Prev by Date: JSDT chat room
- Next by Date: problem writing doubles with java filewriter
- Previous by thread: Re: modifying a program
- Next by thread: Re: modifying a program
- Index(es):
Relevant Pages
|