Keyboard Maestro 8.2.4 “Glass Water Calculator” Macro

Keyboard Maestro 8.2.4 “Glass Water Calculator” Macro

The comments at the start of this macro explain this macro in a little more detail. Basically it's a macro to solve the problem of whether you can pour certain quantities of water into a set of three glasses or jugs. I think a simpler version of this problem appeared in the movie Die Hard 3 with Bruce Willis and Samuel L Jackson. https://www.youtube.com/watch?time_continue=13&v=BVtQNK_ZUJg ...if you want some context. This macro finds all possible solutions. I learned a couple of things from studying the results of this macro. For example, there is no way to end up with all three jugs being partially filled. For an 8/5/3 gallon jug, there are 964 possible solutions, and you can achieve all possible solutions except for any solution where the jugs are all partially filled. I never would have guessed that.

Glass Water Calculator.kmmacros (19 KB)

1 Like