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
22bed7cf
authored
Dec 21, 2021
by
Stuart Kurtz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Day 21, now with correct comment.
parent
b5032e1d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
src/AOC-21b.hs
src/AOC-21b.hs
View file @
22bed7cf
...
...
@@ -7,9 +7,9 @@ splits :: [(Int,Integer)]
splits
=
M
.
assocs
$
roll
3
(
M
.
singleton
0
1
)
where
roll
::
Int
->
M
.
Map
Int
Integer
->
M
.
Map
Int
Integer
roll
0
m
=
m
roll
n
m
=
roll
(
n
-
1
)
$
M
.
unionsWith
(
+
)
.
map
((`
M
.
mapKeys
`
m
)
.
(
+
))
$
[
1
,
2
,
3
]
roll
n
m
=
roll
(
n
-
1
)
.
M
.
unionsWith
(
+
)
.
map
((`
M
.
mapKeys
`
m
)
.
(
+
))
$
[
1
,
2
,
3
]
-- universes x
Pos xScore yPos yScore
= (losers,winners)
-- universes x
Score 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