Created
March 25, 2015 22:21
-
-
Save CashWilliams/339b0b1b28c46e5a0095 to your computer and use it in GitHub Desktop.
Agent PHP Test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCodeNumberByName($name) { | |
switch ($name) { | |
case 'Edward Donne': | |
return 001; | |
case 'Scarlett Papava': | |
return 004; | |
case 'Stuart Thomas': | |
return 006; | |
case 'James Bond': | |
return 007; | |
case 'Bill Timothy': | |
return 008; | |
case 'Cederic': | |
return 0011; | |
case 'Sam Johnston': | |
return 0012; | |
case 'Ghost': | |
return 00789; | |
} | |
} | |
function runMission($primary, $secondary) { | |
if ($primary === $secondary) { | |
return "Mission Failed!"; | |
} | |
else { | |
return "Mission Succeeded!"; | |
} | |
} | |
$primaryAgent = getCodeNumberByName('James Bond'); | |
$secondaryAgent = getCodeNumberByName('Ghost'); | |
echo runMission($primaryAgent, $secondaryAgent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment