mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
Sort of functional implementation of 2024 day 24
This commit is contained in:
15
2024/bonus/24todot.py
Normal file
15
2024/bonus/24todot.py
Normal 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("}")
|
||||
Reference in New Issue
Block a user