Created
July 9, 2013 15:58
-
-
Save six519/5958565 to your computer and use it in GitHub Desktop.
Reverse Binary (Spotify Puzzle in PHP)
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
#!/usr/bin/env php | |
<?php | |
$stdIn = fopen("php://stdin","r"); | |
$lineInput = fgets($stdIn); | |
if($lineInput >= 1 && $lineInput <= 1000000000) { | |
echo bindec(strrev(decbin($lineInput))), "\n"; | |
} else { | |
echo "Invalid input\n"; | |
} | |
fclose($stdIn); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment