An open API service indexing awesome lists of open source software.

https://github.com/wwi2196/jug-problem

In this puzzle, you have two water jugs—one that can hold a liters of water and another that can hold b liters of water. The goal is to determine the minimum number of steps required to obtain exactly c liters of water in one of the vessels.
https://github.com/wwi2196/jug-problem

Last synced: 3 months ago
JSON representation

In this puzzle, you have two water jugs—one that can hold a liters of water and another that can hold b liters of water. The goal is to determine the minimum number of steps required to obtain exactly c liters of water in one of the vessels.

Awesome Lists containing this project

README

        

## The Two Water Jugs Puzzle
Given two jugs, one of which can accommodate #a liter of water and the other #b liters of
water, determine the number of steps required to obtain exactly c liters of water in one of
the vessels.

At the beginning, both vessels are empty. The following operations are counted as 'steps':
● emptying avessel
● filling a vessel
● pouring water from one jug to the other, without spilling, until one of the jugs is either full or empty.