From a6efae14f9f20a225dcb1d7a3e45946c991b386e Mon Sep 17 00:00:00 2001 From: Clement Desmidt Date: Wed, 1 Dec 2021 17:04:58 +0100 Subject: [PATCH] :tada: initialise le repo comme en 2020 et 2019 --- .gitignore | 2 ++ add.sh | 19 +++++++++++++++++++ day_1/part_1.php | 15 +++++++++++++++ day_1/part_2.php | 18 ++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 .gitignore create mode 100755 add.sh create mode 100644 day_1/part_1.php create mode 100644 day_1/part_2.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d5a90de --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +input.txt +/.idea \ No newline at end of file diff --git a/add.sh b/add.sh new file mode 100755 index 0000000..89c9837 --- /dev/null +++ b/add.sh @@ -0,0 +1,19 @@ +#!/usr/bin/zsh + +SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )" +NUMBER=$1 + +if [ ! -d "${SCRIPT_PATH}/day_${NUMBER}" ]; then + mkdir "${SCRIPT_PATH}/day_${NUMBER}" +else + echo "folder ${SCRIPT_PATH}/day_${NUMBER} already exists" + exit +fi + +cd "${SCRIPT_PATH}/day_${NUMBER}" || exit + +touch input.txt part_1.php part_2.php + +echo "DONE" + +exit \ No newline at end of file diff --git a/day_1/part_1.php b/day_1/part_1.php new file mode 100644 index 0000000..d09ab0a --- /dev/null +++ b/day_1/part_1.php @@ -0,0 +1,15 @@ + $current) { + $count++; + } + + $current = $number; +} + +echo $count; \ No newline at end of file diff --git a/day_1/part_2.php b/day_1/part_2.php new file mode 100644 index 0000000..7309e31 --- /dev/null +++ b/day_1/part_2.php @@ -0,0 +1,18 @@ + $current_slice) { + $count++; + } + + $current_slice = $new_slice; +} + +echo $count; \ No newline at end of file