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

https://github.com/mohit-s96/die-hard-3-jug-problem-solver

Illustrated general case solution for 2 jug problem from the action movie Die Hard 3
https://github.com/mohit-s96/die-hard-3-jug-problem-solver

css3 math-problems puzzle-solver recursive-algorithm vanilla-js

Last synced: about 2 months ago
JSON representation

Illustrated general case solution for 2 jug problem from the action movie Die Hard 3

Awesome Lists containing this project

README

        

2 Bucket Problem Solver
Problem Statement : Suppose you have a "p" liter bucket and a "q" liter bucket. There is no other conatainer and neither do the buckets have measurement lines on them. How could you measure exactly "r" liters using only those buckets and you have as much extra water as you need ?

Rule 1 : p > q
Rule 2 : p > r
Rule 3 : r mod gcd(p, q) = 0

[NOTE : The rule enforcing is done by the program so you don't have to calculate it yourself :) ]

![GitHub Logo](/img/screenshot.jpg)