Sort of functional implementation of 2024 day 24

This commit is contained in:
2024-12-24 20:56:12 +01:00
parent 48824288b0
commit e949ce9932
4 changed files with 183 additions and 0 deletions

15
2024/bonus/24todot.py Normal file
View File

@@ -0,0 +1,15 @@
import fileinput
print("digraph day24 {")
for line in fileinput.input():
parts = line.split(" ")
if len(parts) != 5:
continue
first, op, second, _, result = parts
print(f'{first}{second}{op} [label="{op}"];')
print(f"{first} -> {first}{second}{op} -> {result};")
print(f"{second} -> {first}{second}{op};")
print("}")