💥 Ajoute les fonctions communes

This commit is contained in:
Clement Desmidt
2026-01-12 15:22:11 +01:00
parent d9a6efe3c6
commit 4b3f8412c9
2 changed files with 13 additions and 0 deletions

3
add.sh
View File

@@ -14,6 +14,9 @@ cd "${SCRIPT_PATH}/day_${NUMBER}" || exit
touch input.txt part_1.php part_2.php touch input.txt part_1.php part_2.php
echo -e "<?php\n\ninclude '../functions.php';\n\n" >> part_1.php
echo -e "<?php\n\ninclude '../functions.php';\n\n" >> part_2.php
echo "DONE" echo "DONE"
exit exit

10
functions.php Normal file
View File

@@ -0,0 +1,10 @@
<?php
function print_message(string|array $message)
{
if (is_array($message)) {
$message = implode("\n", $message);
}
echo $message."\n";
}