Hacker News new | ask | show | jobs
Show HN: Water Pouring Problem Simulation (fyquah.me)
23 points by fyquah95 3508 days ago
5 comments

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

Adding this video to the page, thanks for sharing!
You can solve this problem faster using the extended Euclidean algorithm.
Does the algorithm yield the exact path to the target volume?
It will be nice to have a list with all steps at the end
Intuitively, to be possible I think the target amount has to be divisible by the gcf of the two jugs.
Thought it is real water pouring simulation..