From 1030b26b3108a4cd962cb353188cbaa9cb4e3362 Mon Sep 17 00:00:00 2001 From: Brechtje van Gessel Date: Mon, 1 Dec 2025 09:14:39 +0100 Subject: [PATCH] first attempt, answer too low --- brechtje/1/1-1.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 brechtje/1/1-1.py diff --git a/brechtje/1/1-1.py b/brechtje/1/1-1.py new file mode 100644 index 0000000..5cc6a11 --- /dev/null +++ b/brechtje/1/1-1.py @@ -0,0 +1,20 @@ +input = open("input.txt", "r").read().splitlines() + +pos = 50 +password = 0 + +for line in input: + if line.startswith('L'): + pos -= int(line[1:]) + elif line.startswith('R'): + pos += int(line[1:]) + + if pos < 0: + pos += 100 + elif pos > 99: + pos -= 100 + + if pos == 0: + password += 1 + +print(password) \ No newline at end of file