Skip to content

Commit

Permalink
Renaming of functions
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-rysaev committed May 29, 2020
1 parent b89fedf commit b730ebe
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions bin/brain-calc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php

use function BrainGames\Calc\calc;
use function BrainGames\Calc\brainCalc;

$autoloadPath1 = __DIR__ . '/../../../autoload.php';
$autoloadPath2 = __DIR__ . '/../vendor/autoload.php';
Expand All @@ -11,4 +11,4 @@ if (file_exists($autoloadPath1)) {
require_once $autoloadPath2;
}

calc();
brainCalc();
4 changes: 2 additions & 2 deletions bin/brain-even
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php

use function BrainGames\Even\even;
use function BrainGames\Even\brainEven;

$autoloadPath1 = __DIR__ . '/../../../autoload.php';
$autoloadPath2 = __DIR__ . '/../vendor/autoload.php';
Expand All @@ -11,4 +11,4 @@ if (file_exists($autoloadPath1)) {
require_once $autoloadPath2;
}

even();
brainEven();
4 changes: 2 additions & 2 deletions bin/brain-gcd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php

use function BrainGames\GCD\gcd;
use function BrainGames\GCD\brainGCD;

$autoloadPath1 = __DIR__ . '/../../../autoload.php';
$autoloadPath2 = __DIR__ . '/../vendor/autoload.php';
Expand All @@ -11,4 +11,4 @@ if (file_exists($autoloadPath1)) {
require_once $autoloadPath2;
}

gcd();
brainGCD();
4 changes: 2 additions & 2 deletions bin/brain-prime
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php

use function BrainGames\Prime\prime;
use function BrainGames\Prime\brainPrime;

$autoloadPath1 = __DIR__ . '/../../../autoload.php';
$autoloadPath2 = __DIR__ . '/../vendor/autoload.php';
Expand All @@ -11,4 +11,4 @@ if (file_exists($autoloadPath1)) {
require_once $autoloadPath2;
}

prime();
brainPrime();
4 changes: 2 additions & 2 deletions bin/brain-progression
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php

use function BrainGames\Progression\progression;
use function BrainGames\Progression\brainProgression;

$autoloadPath1 = __DIR__ . '/../../../autoload.php';
$autoloadPath2 = __DIR__ . '/../vendor/autoload.php';
Expand All @@ -11,4 +11,4 @@ if (file_exists($autoloadPath1)) {
require_once $autoloadPath2;
}

progression();
brainProgression();
2 changes: 1 addition & 1 deletion src/games/Calc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use const BrainGames\Engine\ROUNDS_COUNT;

function calc()
function brainCalc()
{
$mission = 'What is the result of the expression?';

Expand Down
2 changes: 1 addition & 1 deletion src/games/Even.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function isEven($number)
return $number % 2 == 0;
}

function even()
function brainEven()
{
$mission = 'Answer "yes" if the number is even, otherwise answer "no".';

Expand Down
2 changes: 1 addition & 1 deletion src/games/GCD.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function getGCD($a, $b)
return $a + $b;
}

function gcd()
function brainGCD()
{
$mission = 'Find the greatest common divisor of given numbers.';

Expand Down
2 changes: 1 addition & 1 deletion src/games/Prime.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function isPrime($number)
return true;
}

function prime()
function brainPrime()
{
$mission = 'Answer "yes" if given number is prime. Otherwise answer "no".';

Expand Down
4 changes: 2 additions & 2 deletions src/games/Progression.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@

use const BrainGames\Engine\ROUNDS_COUNT;

function progression()
function brainProgression()
{
$mission = 'What number is missing in the progression?';

for ($i = 0; $i < ROUNDS_COUNT; $i++) {
$progressionSize = 10;
$step = rand(1, 10);
$maskedPosition = rand(0, $progressionSize - 1);
$startNumber = rand(1, 10);

for ($j = 0; $j < $progressionSize; $j++) {
$progression[] = $startNumber + $step * $j;
}

$maskedPosition = array_rand($progression);
$answer = (string) $progression[$maskedPosition];
$progression[$maskedPosition] = '..';
$question = implode(' ', $progression);
Expand Down

0 comments on commit b730ebe

Please sign in to comment.