code: def k_in_row(self, board, move, player, (delta_x, delta_y)):
          "Return true if there is a line through move on board for player."
          x, y = move
          n = 0 # n is number of moves in row
          while board.get((x, y)) == player:
              n += 1
              x, y = x + delta_x, y + delta_y
          x, y = move
          while board.get((x, y)) == player:
              n += 1
              x, y = x - delta_x, y - delta_y
          n -= 1 # Because we counted move itself twice
          return n >= self.f k_in_row(self, board, move, player, (delta_x, delta_y)):
          "Return true if there is a line through move on board for player."
          x, y = move
          n = 0 # n is number of moves in row
          while board.get((x, y)) == player:
              n += 1
              x, y = x + delta_x, y + delta_y
          x, y = move
          while board.get((x, y)) == player:
              n += 1
              x, y = x - delta_x, y - delta_y
          n -= 1 # Because we counted move itself twice
          return n >= self.k
docs: Return true if there is a line through move on board for player.