Fix merge abseil - v6.10

This commit is contained in:
Laurent Perron
2018-11-28 10:37:45 +01:00
committed by Corentin Le Molgat
parent b027e57e95
commit f2573d33b1
35 changed files with 2462 additions and 3935 deletions

View File

@@ -1,4 +1,4 @@
# Copyright 2010-2017 Google
# Copyright 2010-2018 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -31,13 +31,10 @@ def build_pairs(rows, cols):
rows: the number of rows in the grid
cols: the number of columns in the grid
"""
return [
(x * cols + y, (x + dx) * cols + (y + dy)) for x in range(rows)
for y in range(cols) for dx in (-1, 0, 1)
for dy in (-1, 0, 1)
if (x + dx >= 0 and x + dx < rows and y + dy >= 0 and y + dy < cols and
(dx != 0 or dy != 0))
]
return [(x * cols + y, (x + dx) * cols + (y + dy)) for x in range(rows)
for y in range(cols) for dx in (-1, 0, 1) for dy in (-1, 0, 1)
if (x + dx >= 0 and x + dx < rows and y + dy >= 0 and y + dy < cols
and (dx != 0 or dy != 0))]
def print_solution(positions, rows, cols):