Skip to content

Commit

Permalink
Day 9 solution using a doubly linked list.
Browse files Browse the repository at this point in the history
  • Loading branch information
jayfoad committed Dec 17, 2018
1 parent 4631855 commit b060f3f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions p9.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
470 players; last marble is worth 72170 points
10 changes: 10 additions & 0 deletions p9list.dyalog
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
⎕IO0
(p w)¨'\d+'⎕S'&'⊃⊃⎕NGET'p9.txt'1

ins{q(p 1m)1m nm[(p 1)(q 0)]m mp q n}
del{f{ 0m} pf(r,f(qf6)) m[(p 1)(q 0)]q p m0 q}
run{ins(23|)del(ins22)(÷23)0}
hscore{/+z(×z÷r)r+23×1+r}

r m1 20 (hscore p)run w part 1
r m1 20 (hscore p)run w×100 part 2

0 comments on commit b060f3f

Please sign in to comment.