 
         return @
 
-    solvable: (pos) ->
+    solvable: ->
         [erow, _] = @position[@emptyID]
         [inversions, _] = countInversions(@grid, @emptyID)
         return solvable(inversions, @rows, @cols, erow + 1)

            @swap([r, col], @emptyID) for r in [erow..row]
        return @

    slidable: (pos) ->
        [row, col] = toPos.call(@, pos)
        [erow, ecol] = @position[@emptyID]
        return (0 <= row < @rows and 0 <= col < @cols) and
            not (row == erow and col == ecol) and

    toString.call(obj) == '[object Array]'


toPos = (posid) ->
    return if isArray(posid) then posid else @position[posid]


class Sliding
