Remove test file

This commit is contained in:
Miguel Nogueira 2020-02-18 19:54:40 +00:00
parent 3688a6a2df
commit a5e0bf5a41
1 changed files with 0 additions and 70 deletions

View File

@ -1,70 +0,0 @@
<?php
require 'vendor/autoload.php';
use miguel456\rps\Core\Paper;
use miguel456\rps\Core\Rock;
use miguel456\rps\Core\Scissors;
$humanChoice = 'scissors';
$computerChoice = 'paper';
echo 'debug: ' . PHP_EOL;
echo 'human: ' . $humanChoice . PHP_EOL;
echo 'robot: ' . $computerChoice . PHP_EOL;
echo PHP_EOL;
switch ($humanChoice)
{
case 'rock':
$humanChoiceItem = new Rock();
break;
case 'paper':
$humanChoiceItem = new Paper();
break;
case 'scissors':
$humanChoiceItem = new Scissors();
break;
default:
exit('Invalid choice!');
}
switch ($computerChoice)
{
case 'rock':
$computerChoiceItem = new Rock();
break;
case 'paper':
$computerChoiceItem = new Paper();
break;
case 'scissors':
$computerChoiceItem = new Scissors();
break;
default:
exit('Internal error: Invalid computer choice.');
}
$result = $humanChoiceItem->evaluateMatch($computerChoiceItem);
if ($result['defeated'])
{
echo 'You lose! The computer chose ' .$computerChoiceItem->getName();
}
else
{
echo 'You win! The computer chose ' . $computerChoiceItem->getName();
}
echo PHP_EOL;