Skip to content

Commit

Permalink
with verbs
Browse files Browse the repository at this point in the history
  • Loading branch information
Egorskov committed Oct 20, 2024
1 parent 48af88e commit b01c08a
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions bin/brain-calc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ if (file_exists($autoloadPath1)) {
require_once $autoloadPath2;
}

use function BrainGames\Games\Calc\calc;
use function BrainGames\Games\Calc\runCalc;

calc();
runCalc();
4 changes: 2 additions & 2 deletions bin/brain-even
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ if (file_exists($autoloadPath1)) {
require_once $autoloadPath2;
}

use function BrainGames\Games\Even\even;
use function BrainGames\Games\Even\runEven;

even();
runEven();
4 changes: 2 additions & 2 deletions bin/brain-gcd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ if (file_exists($autoloadPath1)) {
require_once $autoloadPath2;
}

use function BrainGames\Games\Gcd\gcd;
use function BrainGames\Games\Gcd\runGcd;

gcd();
runGcd();
4 changes: 2 additions & 2 deletions bin/brain-prime
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ if (file_exists($autoloadPath1)) {
require_once $autoloadPath2;
}

use function BrainGames\Games\Prime\prime;
use function BrainGames\Games\Prime\runPrime;

prime();
runPrime();
4 changes: 2 additions & 2 deletions bin/brain-progression
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ if (file_exists($autoloadPath1)) {
require_once $autoloadPath2;
}

use function BrainGames\Games\Progression\progression;
use function BrainGames\Games\Progression\runProgression;

progression();
runProgression();
2 changes: 1 addition & 1 deletion src/Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function communication(array $answers, string $game): void
function arrayNumbers(): array
{
$numbers = [];
for ($i = 0; $i < ROUND; $i++) {
for ($i = 1; $i <= ROUND; $i++) {
$numbers[$i] = mt_rand(MIN_NUM, MAX_NUM);
}
return $numbers;
Expand Down
2 changes: 1 addition & 1 deletion src/Games/Calc.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use const BrainGames\Engine\MIN_NUM;
use const BrainGames\Engine\MAX_NUM;

function calc(): void
function runCalc(): void
{
$game = 'What is the result of the expression?';
$answers = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Games/Even.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use function BrainGames\Engine\communication;
use function BrainGames\Engine\arrayNumbers;

function even(): void
function runEven(): void
{
$game = 'Answer "yes" if the number is even, otherwise answer "no".';
$answers = [];
Expand Down
4 changes: 2 additions & 2 deletions src/Games/GCD.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
use const BrainGames\Engine\MIN_NUM;
use const BrainGames\Engine\MAX_NUM;

function gcd(): void
function runGcd(): void
{
$game = 'Find the greatest common divisor of given numbers.';
$answers = [];
for ($i = 0; $i < ROUND; $i++) {
for ($i = 1; $i <= ROUND; $i++) {
$first = mt_rand(MIN_NUM, MAX_NUM);
$second = mt_rand(MIN_NUM, MAX_NUM);
$answers["$first $second"] = nod($first, $second);
Expand Down
2 changes: 1 addition & 1 deletion src/Games/Prime.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use function BrainGames\Engine\arrayNumbers;
use function BrainGames\Engine\communication;

function prime(): void
function runPrime(): void
{
$game = 'Answer "yes" if given number is prime. Otherwise answer "no".';
$answers = [];
Expand Down
4 changes: 2 additions & 2 deletions src/Games/Progression.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
use const BrainGames\Engine\MIN_NUM;
use const BrainGames\Engine\MAX_NUM;

function progression(): void
function runProgression(): void
{
$game = 'What number is missing in the progression?';
$answers = [];
for ($i = 0; $i < ROUND; $i++) {
for ($i = 1; $i <= ROUND; $i++) {
$numbers = slicer();
$randomSym = mt_rand(0, (count($numbers) - 1));
$correctAnswer = $numbers[$randomSym];
Expand Down

0 comments on commit b01c08a

Please sign in to comment.