Skip to content

Conversation

@kevint98
Copy link

@kevint98 kevint98 commented Jan 9, 2024

No description provided.

@@ -144,38 +92,84 @@ function wasCorrectlyAnswered() {
if ($this->currentPlayer == count($this->players)) $this->currentPlayer = 0;
Copy link

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');
Copy link

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');
Copy link

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);
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants