-
Notifications
You must be signed in to change notification settings - Fork 66
Code review exercise: Kevin Thompson #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| @@ -144,38 +92,84 @@ function wasCorrectlyAnswered() { | |||
| if ($this->currentPlayer == count($this->players)) $this->currentPlayer = 0; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was it possible to avoid this magic number and add it somewhere else?
| . " now has " | ||
| .$this->purses[$this->currentPlayer] | ||
| . " Gold Coins."); | ||
| $this->getAnswerOutcome('correct'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could probably extract this and add it to a variable on the top called "correct" or "correctAnswer".
| $this->inPenaltyBox[$this->currentPlayer] = true; | ||
| function wasNotCorrectlyAnswered() | ||
| { | ||
| $this->getAnswerOutcome('incorrect'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same here.
| function didPlayerWin() { | ||
| function didPlayerWin() | ||
| { | ||
| return !($this->purses[$this->currentPlayer] == 6); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see a magic number that you could probably extract it.
No description provided.