diff --git "a/Retos/Reto #1 - EL LENGUAJE HACKER [F\303\241cil]/php/lombervid.php" "b/Retos/Reto #1 - EL LENGUAJE HACKER [F\303\241cil]/php/lombervid.php" new file mode 100644 index 0000000000..9856a806b2 --- /dev/null +++ "b/Retos/Reto #1 - EL LENGUAJE HACKER [F\303\241cil]/php/lombervid.php" @@ -0,0 +1,55 @@ + "4", + "b" => "I3", + "c" => "[", + "d" => ")", + "e" => "3", + "f" => "|=", + "g" => "&", + "h" => "#", + "i" => "1", + "j" => ",_|", + "k" => ">|", + "l" => "1", + "m" => "/\\/\\", + "n" => "^/", + "o" => "0", + "p" => "|*", + "q" => "(_,)", + "r" => "I2", + "s" => "5", + "t" => "7", + "u" => "(_)", + "v" => "\\/", + "w" => "\\/\\/", + "x" => "><", + "y" => "j", + "z" => "2", + ]; + + return str_replace(array_keys($alphabet), array_values($alphabet), strtolower($input)); +} + +// Main code +$cases = [ + "demo" => ")3/\\/\\0", + "hacker" => "#4[>|3I2", + "Hello World!" => "#3110 \\/\\/0I21)!", +]; + +foreach ($cases as $input => $want) { + $got = hackerLanguage($input); + + if ($want === $got) { + print("Case passed:"); + } else { + print("Case failed"); + } + + printf("\n\tinput:\t\"%s\"\n\twant:\t\"%s\"\n\tgot:\t\"%s\"\n\n", $input, $want, $got); +}