Skip to content

Commit a8f1c54

Browse files
Moved const ROUND_COUNT in the Engine
1 parent 7e9aad7 commit a8f1c54

File tree

6 files changed

+12
-5
lines changed

6 files changed

+12
-5
lines changed

src/Engine.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use function cli\line;
66
use function cli\prompt;
77

8+
const ROUND_COUNT = 3;
9+
810
function greeting(): string
911
{
1012
line('Welcome to the Brain Games!');

src/Games/BrainCalc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
use function BrainGames\Engine\startGame;
66

7+
use const BrainGames\Engine\ROUND_COUNT;
8+
79
const RULES = 'What is the result of the expression?';
8-
const ROUND_COUNT = 3;
910

1011
function startBrainCalc(): void
1112
{

src/Games/BrainEven.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
use function BrainGames\Engine\startGame;
66

7+
use const BrainGames\Engine\ROUND_COUNT;
8+
79
const RULES = 'Answer "yes" if the number is even, otherwise answer "no".';
8-
const ROUND_COUNT = 3;
910

1011
function startBrainEven(): void
1112
{

src/Games/BrainGcd.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
use function BrainGames\Engine\startGame;
66

7+
use const BrainGames\Engine\ROUND_COUNT;
8+
79
const RULES = 'Find the greatest common divisor of given numbers.';
8-
const ROUND_COUNT = 3;
910

1011
function startBrainGcd(): void
1112
{

src/Games/BrainPrime.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
use function BrainGames\Engine\startGame;
66

7+
use const BrainGames\Engine\ROUND_COUNT;
8+
79
const RULES = 'Answer "yes" if given number is prime. Otherwise answer "no".';
8-
const ROUND_COUNT = 3;
910

1011
function startBrainPrime(): void
1112
{

src/Games/BrainProgression.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44

55
use function BrainGames\Engine\startGame;
66

7+
use const BrainGames\Engine\ROUND_COUNT;
8+
79
const RULES = 'What number is missing in the progression?';
8-
const ROUND_COUNT = 3;
910

1011
function startBrainProgression(): void
1112
{

0 commit comments

Comments
 (0)