The 6th problem was to simply rot1 all alphabet characters in the input. <?
while ($line = fgets(STDIN)) {
$line = trim($line);
for ($i = 0; $i < strlen($line); $i++) {
$c = $line{$i};
if ($c == ' ') {
echo $c;
continue;
}
if (strtolower($c) == $c) {
$base = 'a';
} else {
$base = 'A';
}
echo chr(((ord($c) - ord($base) + 1) % 26) + ord($base));
}
echo "\n";
}
/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/
