Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Stuart A Kurtz
/
advent-of-code-2021
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Pipelines
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3c517c8b
authored
Dec 21, 2021
by
Stuart Kurtz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Day 21, with major part a cleanups and improved comments.
parent
958e7551
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
1 deletions
src/AOC-21b.hs
src/AOC-21b.hs
View file @
3c517c8b
...
...
@@ -14,7 +14,7 @@ splits = M.assocs $ roll 3 (M.singleton 0 1) where
roll
0
m
=
m
roll
n
m
=
roll
(
n
-
1
)
.
M
.
unionsWith
(
+
)
.
map
((`
M
.
mapKeys
`
m
)
.
(
+
))
$
[
1
,
2
,
3
]
-- universes (xScore,xPos,yScore,yPos) = (losers,winners)
-- universes
!
(xScore,xPos,yScore,yPos) = (losers,winners)
-- where player X will make the next move.
universes
::
Array
(
Int
,
Int
,
Int
,
Int
)
(
Integer
,
Integer
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment