Account for cases where the target is higher than Jug A's capacity

This commit is contained in:
lolabird 2024-02-29 15:21:18 -07:00
commit ea11be8560

View file

@ -5,6 +5,10 @@
def fillJug(rounds, jugA, jugB, target):
pour = 0
if target > jugA["cap"]:
print("Target is too high. Reducing target to Jug A's capacity.")
target = jugA["cap"]
if jugA["state"] == target:
print("Target reached")
return