Add condition for when the target is also the cap for jug A

This commit is contained in:
lolabird 2024-02-29 15:16:32 -07:00
commit f06ea2136f

View file

@ -23,7 +23,7 @@ def fillJug(rounds, jugA, jugB, target):
jugB["state"] -= pour jugB["state"] -= pour
print(rounds, jugA, jugB) print(rounds, jugA, jugB)
if jugA["state"] == jugA["cap"]: if jugA["state"] == jugA["cap"] and jugA["state"] != target:
jugA["state"] = 0 #empty jugA if full jugA["state"] = 0 #empty jugA if full
print(rounds, jugA, jugB) print(rounds, jugA, jugB)