[program-l] small board game advice requested

  • From: Florian-achtige <florianbeijers@xxxxxxxxx>
  • To: program-l <program-l@xxxxxxxxxxxxx>
  • Date: Tue, 9 Oct 2012 08:31:13 -1200

Hello list,

For an assignment I am trying to create a text-based self-playing
board game. I intend to have two variables update themselves while
iterating through an array which is the board. I however keep getting
the loops confused and am wondering if there is a simpler way to do
this. Here's my outline:

First, player a rolls a die. I use the Random class for this, the
nextInt() function set to 6, for a six-sided die.
Then, the variable updates itself by adding the number of points on
the die to its total. Also, the corresponding index of the array must
be accessed, because some array elements have certain expressions to
benefit or hinder the player, think the obstacles on a monopoly game
board.
These two keep getting tangled up in my mind though when I attempt to
do both ...The two player variables I use because I use a while loop
to continue the game until one of the two exceeds 60.

I am using the Java programming language and would like to ask for a
few hints. If you just want to point me at some resources that is fine
too, I am just stuck and not sure where I should be looking for a
solution.

Thanks a lot in advance,
Florian
** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: