convey high/low hints if present

This commit is contained in:
Stefan Harmuth 2023-12-03 14:51:57 +01:00
parent de8796d415
commit db23b11a98

View File

@ -168,8 +168,9 @@ class AOCDay:
"https://adventofcode.com/%d/day/%d#part2" % (self.year, self.day) "https://adventofcode.com/%d/day/%d#part2" % (self.year, self.day)
) )
elif "That's not the right answer" in message: elif "That's not the right answer" in message:
hilo = re.findall("was too (high|low)", message)
answer_cache[str_day][str_part]["wrong"].append(answer) answer_cache[str_day][str_part]["wrong"].append(answer)
print("That's WRONG!") print("That's WRONG%s!" % (f" (too {hilo[0]})" if hilo else ""))
elif "You gave an answer too recently" in message: elif "You gave an answer too recently" in message:
# WAIT and retry # WAIT and retry
wait_pattern = r"You have (?:(\d+)m )?(\d+)s left to wait" wait_pattern = r"You have (?:(\d+)m )?(\d+)s left to wait"