Java version of 2048 for 49C.