Maze & 2048 implementation in Java