Skip to content

Instantly share code, notes, and snippets.

@CashWilliams
Created March 25, 2015 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CashWilliams/339b0b1b28c46e5a0095 to your computer and use it in GitHub Desktop.
Save CashWilliams/339b0b1b28c46e5a0095 to your computer and use it in GitHub Desktop.
Agent PHP Test
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