check top - right cell
if ( ( elex > 0 ) and ( eley < n - 1 ) and ( rect [ elex - 1 ] [ eley + 1 ] == 0 ) ) : NEW_LINE INDENT rect [ elex - 1 ] [ eley + 1 ] = 1 NEW_LINE v = [ elex - 1 , eley + 1 ] NEW_LINE qu . put ( v ) NEW_LINE DEDENT