I want to move a block but not two

I am trying to make a puzzle game, where I have to move blocks to get to the exit. I would like to be able to move one block(at a time) but not two(at a time).

eg{
0 is the character
is the block
: is the wall

what I want to happen with one block
:0 to : 0

what I want to happen with two blocks
:0 to :0 (No movement)
}

As others say, this is game logic.

You need to script your game logic.

Other people are not going to write your game for you.