aoc-2022

My solutions in postscript to Advent of Code 2022
Log | Files | Refs | README | LICENSE

commit bd47b0846245f36e70b84dd0c3a98b37f3bd9e10
parent 6cd2d397f7fda5e4c3c676013e7985290991daed
Author: Natasha Kerensikova <natacha@instinctive.eu>
Date:   Sat, 17 Dec 2022 14:00:15 +0100

Add day 16 full solution

Diffstat:
Mday16.ps | 32++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+), 0 deletions(-)

diff --git a/day16.ps b/day16.ps @@ -467,5 +467,37 @@ nz-valve-list { 15 string cvs show +(Second Puzzle: ) +72 664 moveto show +0 0 1 1 nz-pow 2 sub { + % prev-progress prev-best my-mask + dup 100 mul nz-pow 2 sub idiv + % prev-progress prev-best my-mask cur-progress + 3 index 1 index eq + { pop } + { stderr (\015Second puzzle at ) writestring + stderr 1 index 15 string cvs writestring + stderr (%) writestring + stderr flushfile + % prev-progress prev-best my-mask cur-progress + 4 1 roll 3 2 roll pop + % cur-progress prev-best my-mask + } + ifelse + % progress prev-best my-mask + nz-pow 1 sub 1 index sub + % progress prev-best my-mask elephant-mask + (AA) exch best-score-from 25 get + % progress prev-best my-mask elephant-score + exch (AA) exch best-score-from 25 get + % progress prev-best elephant-score my-score + add + % progress prev-best total-score + 2 copy lt { exch } if pop + % progress best-score +} for +stderr 10 write +15 string cvs show + showpage quit