Defined valid moving equation for klotski