Change place by other objects

hi guys
i wanna to develop a game that in the guess category game
we have 3 box and one pet
the boxes must be move to other box place
i dont have any idea about any algorithms
we have some boxes that they must be changed by place

thank you