summaryrefslogtreecommitdiff
path: root/2015/01/not_quite_lisp.py
diff options
context:
space:
mode:
Diffstat (limited to '2015/01/not_quite_lisp.py')
-rw-r--r--2015/01/not_quite_lisp.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/2015/01/not_quite_lisp.py b/2015/01/not_quite_lisp.py
new file mode 100644
index 0000000..d7c59d4
--- /dev/null
+++ b/2015/01/not_quite_lisp.py
@@ -0,0 +1,9 @@
+floor = 0
+with open("input", encoding="utf-8") as f:
+ text = f.read()
+for char in text:
+ if char == '(':
+ floor += 1
+ elif char == ')':
+ floor -= 1
+print(f"floor is {floor}")