refactor(lvl06/ressources): adding the php formatted

This commit is contained in:
Raphael 2026-01-27 14:53:28 +01:00
parent f05354f79d
commit 59e6e6d927
No known key found for this signature in database

20
level06/ressources/level06.php Executable file
View file

@ -0,0 +1,20 @@
#!/usr/bin/php
<?php
function y($m)
{
$m = preg_replace("/\./", " x ", $m);
$m = preg_replace("/@/", " y", $m);
return $m;
}
function x($y, $z)
{
$a = file_get_contents($y);
$a = preg_replace("/(\[x (.*)\])/e", "y(\"\\2\")", $a);
$a = preg_replace("/\[/", "(", $a);
$a = preg_replace("/\]/", ")", $a);
return $a;
}
$r = x($argv[1], $argv[2]);
pr $r;
?>