Skip to main content

Timeline for AoCG2021 Day 16: Interpret Duet

Current License: CC BY-SA 4.0

11 events
when toggle format what by license comment
Dec 19, 2021 at 2:05 comment added pxeger r can be empty since p defaults to 0 anyway
Dec 19, 2021 at 0:29 comment added Ajax1234 @pxeger Thank you! Have not had time to make all the changes, but will get around to it. Thanks
Dec 19, 2021 at 0:29 history edited Ajax1234 CC BY-SA 4.0
deleted 78 characters in body
Dec 16, 2021 at 4:10 comment added pxeger You don't need the parentheses in i['i']+=(not r)
Dec 16, 2021 at 4:08 comment added pxeger You can replace the dicts {'i':0} with one-item lists [0], and then access them with i[0] instead of i['i']
Dec 16, 2021 at 1:30 comment added pxeger The [i.split()for i in p.split('\n')] can be combined into the inside of f so you can remove the l function
Dec 16, 2021 at 1:30 comment added pxeger (1 if not u(s[k][1],n) else u(s[k][2],n)) -> (not u(s[k][1],n)or u(s[k][2],n)). You have a few unneeded spaces as well, like in if (v:=... and n[s[k][1]], u(s[k][2],n).
Dec 16, 2021 at 1:28 comment added pxeger and not any([r,s]) -> and not(r or s)
Dec 16, 2021 at 1:27 comment added pxeger Also, since the set of instructions is so limited, you can probably use some lexicographic comparisons with < and > instead of ==
Dec 16, 2021 at 1:25 comment added pxeger You can swap the comparisons if v=='snd' -> if'snd'==v to save a byte on whitespace
Dec 16, 2021 at 1:17 history answered Ajax1234 CC BY-SA 4.0