Subtask 4.3 move check


the subtask says that moving left has an effect on the row if there is an adjacent empty space (left of a tile), should this tile be not empty? I mean if this is the row 2,0,0,0 or 0,0,0,0 should we consider this as having an effect and return 1 because a move to the left would be possible? or we shouldn’t because there is no empty space left of a non zero tile?

1 Like

There is no such thing as a zero/empty tile. Only a space can be empty if there is no tile inhabiting it. The presence of a tile is indicated by a non-zero value, which is also the value of the tile.

ok thanks, and if a row looks like 2,0,0,0 or 0,0,0,0 (by zero I mean an empty space in the row). should we the function return 1 or 0?

0 is returned for both. There are no two adjacent spaces with the right one containing a tile and the left one being empty.