diff options
| author | Andreas Grois <andi@grois.info> | 2024-12-17 19:47:14 +0100 |
|---|---|---|
| committer | Andreas Grois <andi@grois.info> | 2024-12-17 19:47:14 +0100 |
| commit | 19d4b4e41a967c0c8b3329cd1c4a0617178c5a94 (patch) | |
| tree | e5aff19158c526ebf5fbec2b51c8cde9da8e129f /Day14.lean | |
| parent | 8f1a6c619a238531aed9dd3f4479d658fcf1d101 (diff) | |
Lean 4.14
Diffstat (limited to 'Day14.lean')
| -rw-r--r-- | Day14.lean | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -211,11 +211,11 @@ private def compareControlPanels (a b : ControlPanel) : Bool := /-- (Bad) Hash-Function for ControlPanel. It's good enough for this riddle, but that's about it. -/ private def hashControlPanel (p : ControlPanel) : UInt64 := Id.run do - let mut hash : UInt64 := mixHash ⟨Fin.ofNat' _ p.width⟩ ⟨Fin.ofNat' _ p.height⟩ + let mut hash : UInt64 := mixHash ⟨Fin.ofNat' UInt64.size p.width⟩ ⟨Fin.ofNat' UInt64.size p.height⟩ for hi : index in [:p.elements.size] do match p.elements[index] with - | Tile.Round => hash := mixHash hash ⟨Fin.ofNat' _ index⟩ - | Tile.Cube => hash := mixHash hash ⟨Fin.ofNat' _ (index + p.elements.size)⟩ + | Tile.Round => hash := mixHash hash ⟨Fin.ofNat' UInt64.size index⟩ + | Tile.Cube => hash := mixHash hash ⟨Fin.ofNat' UInt64.size (index + p.elements.size)⟩ | Tile.Space => continue hash |
