2048 implemented by Java