Created
September 20, 2016 05:56
-
-
Save robbieaverill/f61ea26f70a8598d9564cda1293611ab to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
/** | |
* Screw you John Campbell! I couldn't work it out either! | |
*/ | |
for ($found = false, $a = 20, $b = 60; $found === false; $a++, $b++) { | |
if ($a + 20 === $b - 20 && ($a - 22) * 2 === $b) { | |
$found = true; | |
echo "$a + 20 = " . ($a+20) . " and $b - 20 = " . ($b-20), PHP_EOL; | |
echo "$a - 22 = " . ($a-22) . " which doubled is the same as $b", PHP_EOL; | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment