removeRows :: Board -> [Int] -> Board
removeRows brd rows = computeVectorS $ traverse brd id determineCell
  where
    numToDrop = length rows
    sh = extent brd
    determineCell lookupBrd spot@(R.Z :. x :. y)
      | y < numToDrop = Nothing
      | otherwise =
        case findIndex (== y) $ reverse $ sort (y:rows) of
             Nothing -> error "what is this I don't even... I JUST PUT THAT THERE"
                        -- this is for cases when the y index of the cell is also a row
                        -- that was just removed :(
             Just offset -> let offset' = if (y `elem` rows) then offset + 1 else offset
                                y' = properY (y - offset')
                            in lookupBrd (R.Z :. x :. y')
    properY y
      | y `elem` rows = properY (y - 1)
      | otherwise = y





-- | Sees if there are any full rows - they mean points!!
  -- [] means no rows were full
  -- [1, 3] means rows 1 and 3 were full!!!
removeRows :: Board -> [Int] -> Board
removeRows brd rows = computeVectorS $ traverse brd id determineCell
  where
    numToDrop = length rows
    sh = extent brd
    determineCell lookupBrd spot@(R.Z :. x :. y)
      | y < numToDrop = Nothing
      | otherwise =
        case findIndex (== y) $ reverse $ sort (y:rows) of
             Nothing -> error "what is this I don't even... I JUST PUT THAT THERE"
                        -- this is for cases when the y index of the cell is also a row
                        -- that was just removed :(
             Just offset -> let offset' = if (y `elem` rows) then offset + 1 else offset
                                y' = properY (y - offset')
                            in lookupBrd (R.Z :. x :. y')
    properY y
      | y `elem` rows = properY (y - 1)
      | otherwise = y





-- | Sees if there are any full rows - they mean points!!
  -- [] means no rows were full
  -- [1, 3] means rows 1 and 3 were full!!!
removeRows brd rows = computeVectorS $ traverse brd id determineCell
  where
    numToDrop = length rows
    sh = extent brd
    determineCell lookupBrd spot@(R.Z :. x :. y)
      | y < numToDrop = Nothing
      | otherwise =
        case findIndex (== y) $ reverse $ sort (y:rows) of
             Nothing -> error "what is this I don't even... I JUST PUT THAT THERE"
                        -- this is for cases when the y index of the cell is also a row
                        -- that was just removed :(
             Just offset -> let offset' = if (y `elem` rows) then offset + 1 else offset
                                y' = properY (y - offset')
                            in lookupBrd (R.Z :. x :. y')
    properY y
      | y `elem` rows = properY (y - 1)
      | otherwise = y





-- | Sees if there are any full rows - they mean points!!
  -- [] means no rows were full
  -- [1, 3] means rows 1 and 3 were full!!!