nix: bump flake inputs
This commit is contained in:
parent
601b40e7d4
commit
94befa4d1b
|
@ -7,7 +7,7 @@ def is_valid_password(p: int) -> bool:
|
|||
digits = str(p)
|
||||
|
||||
def has_adjacent_digit():
|
||||
for (a, b) in zip(digits, digits[1:]):
|
||||
for a, b in zip(digits, digits[1:]):
|
||||
if a == b:
|
||||
return True
|
||||
return False
|
||||
|
|
|
@ -8,7 +8,7 @@ def is_valid_password(p: int) -> bool:
|
|||
|
||||
def has_unique_adjacent_digit():
|
||||
counts = {d: 0 for d in range(10)}
|
||||
for (a, b) in zip(digits, digits[1:]):
|
||||
for a, b in zip(digits, digits[1:]):
|
||||
if a == b:
|
||||
counts[int(a)] += 1
|
||||
return any(count == 1 for count in counts.values())
|
||||
|
|
|
@ -38,7 +38,7 @@ def solve(input: List[str]) -> int:
|
|||
# Second step, do flashes
|
||||
has_flashed: Set[Point] = set()
|
||||
while len(flashes := (excited(levels) - has_flashed)) > 0:
|
||||
for (i, j) in flashes:
|
||||
for i, j in flashes:
|
||||
has_flashed.add((i, j))
|
||||
for x, y in neighbours_of((i, j)):
|
||||
levels[x][y] += 1
|
||||
|
|
|
@ -38,7 +38,7 @@ def solve(input: List[str]) -> int:
|
|||
# Second step, do flashes
|
||||
has_flashed: Set[Point] = set()
|
||||
while len(flashes := (excited(levels) - has_flashed)) > 0:
|
||||
for (i, j) in flashes:
|
||||
for i, j in flashes:
|
||||
has_flashed.add((i, j))
|
||||
for x, y in neighbours_of((i, j)):
|
||||
levels[x][y] += 1
|
||||
|
|
|
@ -11,7 +11,7 @@ def solve(input: List[str]) -> int:
|
|||
def parse() -> Map:
|
||||
res: Map = defaultdict(set)
|
||||
|
||||
for (start, to) in map(lambda s: s.split("-"), input):
|
||||
for start, to in map(lambda s: s.split("-"), input):
|
||||
res[start].add(to)
|
||||
res[to].add(start)
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ def solve(input: List[str]) -> int:
|
|||
def parse() -> Map:
|
||||
res: Map = defaultdict(set)
|
||||
|
||||
for (start, to) in map(lambda s: s.split("-"), input):
|
||||
for start, to in map(lambda s: s.split("-"), input):
|
||||
res[start].add(to)
|
||||
res[to].add(start)
|
||||
|
||||
|
|
|
@ -60,11 +60,11 @@ def solve(input: List[str]) -> int:
|
|||
for x in range(map.dimensions.x):
|
||||
print(
|
||||
"".join(
|
||||
(
|
||||
"v"
|
||||
if Point(x, y) in map.south
|
||||
else ">"
|
||||
if Point(x, y) in map.east
|
||||
else "."
|
||||
else ">" if Point(x, y) in map.east else "."
|
||||
)
|
||||
for y in range(map.dimensions.y)
|
||||
)
|
||||
)
|
||||
|
|
|
@ -20,7 +20,7 @@ class HeightMap:
|
|||
|
||||
def reachable_neighbours(self, p: Point) -> Iterator[Point]:
|
||||
reachable_height = self.heights[p.x][p.y] + 1
|
||||
for (dx, dy) in ((-1, 0), (1, 0), (0, -1), (0, 1)):
|
||||
for dx, dy in ((-1, 0), (1, 0), (0, -1), (0, 1)):
|
||||
x, y = p.x + dx, p.y + dy
|
||||
if x < 0 or x >= len(self.heights):
|
||||
continue
|
||||
|
|
|
@ -20,7 +20,7 @@ class HeightMap:
|
|||
|
||||
def reachable_neighbours(self, p: Point) -> Iterator[Point]:
|
||||
reachable_height = self.heights[p.x][p.y] + 1
|
||||
for (dx, dy) in ((-1, 0), (1, 0), (0, -1), (0, 1)):
|
||||
for dx, dy in ((-1, 0), (1, 0), (0, -1), (0, 1)):
|
||||
x, y = p.x + dx, p.y + dy
|
||||
if x < 0 or x >= len(self.heights):
|
||||
continue
|
||||
|
|
33
flake.lock
33
flake.lock
|
@ -3,11 +3,11 @@
|
|||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1673956053,
|
||||
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -21,11 +21,11 @@
|
|||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1694529238,
|
||||
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -43,11 +43,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1660459072,
|
||||
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
|
||||
"lastModified": 1709087332,
|
||||
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
|
||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -58,11 +58,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1701336116,
|
||||
"narHash": "sha256-kEmpezCR/FpITc6yMbAh4WrOCiT2zg5pSjnKrq51h5Y=",
|
||||
"lastModified": 1731890469,
|
||||
"narHash": "sha256-D1FNZ70NmQEwNxpSSdTXCSklBH1z2isPR84J6DQrJGs=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "f5c27c6136db4d76c30e533c20517df6864c46ee",
|
||||
"rev": "5083ec887760adfe12af64830a66807423a859a7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -75,9 +75,6 @@
|
|||
"pre-commit-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": [
|
||||
"futils"
|
||||
],
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
|
@ -87,11 +84,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1700922917,
|
||||
"narHash": "sha256-ej2fch/T584b5K9sk1UhmZF7W6wEfDHuoUYpFN8dtvM=",
|
||||
"lastModified": 1732021966,
|
||||
"narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=",
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "e5ee5c5f3844550c01d2131096c7271cec5e9b78",
|
||||
"rev": "3308484d1a443fc5bc92012435d79e80458fe43c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
Loading…
Reference in a new issue