Skip to content

Instantly share code, notes, and snippets.

View muhammadihabk's full-sized avatar

Muhammad Ihab muhammadihabk

View GitHub Profile
@muhammadihabk
muhammadihabk / ThreeJugs.py
Created November 7, 2021 11:40
Three Jugs Problem
# Input
alternativesList = [[]]
alternativesList[0] = list(map(int, input("Initial state: ").split()))
goal = list(map(int, input("Goal: ").split()))
# A flag to check if we could make a new alternative
# so that we can decide whether to append it to the alternativesList
newAlternative = False
# Try to reach the goal
def threeJugs():