From f93aa5f05fde597bd7d2f9ac1094636d5976eb04 Mon Sep 17 00:00:00 2001 From: Lauri Jesmin Date: Wed, 6 Dec 2023 16:12:31 +0200 Subject: [PATCH] parandus --- 5/advent_2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/5/advent_2.py b/5/advent_2.py index 0726b24..a1cf842 100755 --- a/5/advent_2.py +++ b/5/advent_2.py @@ -81,7 +81,7 @@ def findmapping(sr, tables, prefix): print(f"{prefix}Mapping {row} {sr} {len(tables)}") allresults.append( findmapping( - SR(row.target + (sr.startpoint - row.source), sr.length), + SR(row.target + (sr.startpoint - row.source), row.endpoint - sr.startpoint), tables, prefix + "#", ) @@ -98,7 +98,7 @@ def findmapping(sr, tables, prefix): return min(allresults) -with open("data2.txt") as file: +with open("data.txt") as file: lines = [line.rstrip() for line in file] tables = []