2048 without GUI in Java