
Show HN: Water Pouring Problem Simulation - fyquah95
http://www.fyquah.me/projects/cups/simulate/
======
thecynh
I wonder how many people tried the "5 and 3 gallon canister, target is 4
gallons" from Die Hard 3 … I know I did!

Context:
[https://www.youtube.com/watch?v=BVtQNK_ZUJg](https://www.youtube.com/watch?v=BVtQNK_ZUJg)

~~~
fyquah95
Adding this video to the page, thanks for sharing!

------
33a
You can solve this problem faster using the extended Euclidean algorithm.

~~~
fyquah95
Does the algorithm yield the exact path to the target volume?

------
jfroma
It will be nice to have a list with all steps at the end

------
bbcbasic
Intuitively, to be possible I think the target amount has to be divisible by
the gcf of the two jugs.

------
fuzzythinker
Thought it is real water pouring simulation..

