void Board::move(Direction direction)
{ 董事会pre_move_board(* this);
prepareForNextMove();
switch (direction) {
case UP:
for (int i = 0; i < dimension; ++i)
for (int j = 0; j < dimension; ++j)
moveVertically(i,j,UP);
break;
case DOWN:
for (int i = dimension-1; i >= 0; --i)
for (int j = 0; j < dimension; ++j)
moveVertically(i,j,DOWN);
break;
case LEFT:
for (int i = 0; i < dimension; ++i)
for (int j = 0; j < dimension; ++j)
moveHorizontally(i,j,LEFT);
break;
case RIGHT:
for (int i = 0; i < dimension; ++i)
for (int j = dimension-1; j >= 0; --j)
moveHorizontally(i,j, RIGHT);
}
正如您在上面的代码中所看到的,&#34;代码形式&#34;只是神秘地跳过了第二行。您可以在降价编辑器中尝试代码。这是为什么?以及如何解决问题?