Index:
[thread]
[date]
[subject]
[author]
From: Nathan Ramiz Haboush <nrh2@acpub.duke.edu>
To :
Date: Sun, 28 Mar 1999 22:22:44 -0500
Re: strategies
Justin Caton wrote:
I agree that the line of code in item 1 should be changed. I figured this
out after I kept getting an infinite loop. the PlayGame function kept
calling playRound in PigPlayer, which does nothing if the score is already
100. Also, the PigPlayer class already has access to
PigGame.WINNING_SCORE since it is a public variable.
> I have two things to bring up:
>
> 1. It seems that in PigGame.java the following line:
> while (myPlayer.getScore() =< PigGame.WINNING_SCORE)
>
> should be changed to:
> while (myPlayer.getScore() < PigGame.WINNING_SCORE)
>
> because a score of 100 should win.
>
> 2. It seems that the playRound function in PigPlayer should be passed
> the total score because otherwise the player will possibly keep playing
> the last round not knowing that he has reached 100 or whatever the
> final score is.
>
> thanks,
> Justin Caton
Index:
[thread]
[date]
[subject]
[author]