Java version of Shut the Box