mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-25 21:00:31 +01:00
16 lines
353 B
Python
16 lines
353 B
Python
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("}")
|