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