Java 2048 solver