« first day (6 days earlier)      last day (1132 days later) » 

01:07
I hate the timing of AoC
I'm always about 20 hours late because I can only answer when I get home from school :\
 
1 hour later…
02:31
@rues Yeah, I've more or less given up on the scoring aspect
For me it drops at 11pm, and I really should not be staying up as late as I normally need to to finish it
So I do it sometime during the day the next day
heh
honestly good on you for having a healthy sleep schedule; keep at it :P
Whoa whoa whoa, I wouldn't go that far
:P
well, i'm comparing to myself
so a rather low bar
03:13
at least you're finishing in the first 10 minutes :P
lol
i mean it's midnight for me so it's not really that late
but then i stay up for another like 4 hours after that
03:36
A surprisingly small amount of these are directed at you, caird + redwolf are just as bad
yep, sleep deprivation is very popular here it seems :P
I'm not that bad, 1:30 is the latest, and that's usually reserved for special occasions
12:00 is usually what I aim for
i literally got to sleep at like 11 in the morning today
03:43
But my YT recommendations have a worryingly large impact on how much sleep I get lol
^^^ -1 hour
then woke up at 9 pm
04:00
I try to get to bed by midnight
Actually, that's sorta my fallback bedtime. I'd like to get to bed earlier
I usually get off my computer at a reasonable time
Then my pupper wants to curl up on the couch and next thing I know it's midnight and I haven't fed the cats yet
04:43
Under 20m
10m
4m
3m
3m
ninja'd
Where is everyone?
2.5m
04:57
Me: here
Interesting, I guess we're going into the caves today
Caves and cliffs in AoC confirmed?
Final boss will be the warden
1.5m
1m
Ooh, the water on the left has turned blue
oh yeah
30s
04:59
30s, glhf
What does that stand for?
Ok, polar opposite of yesterday's
why is my input shitting itself
Part 2 is pain
adventoficantread.com
also why is the sample input on two lines
05:09
19/6
the fucking sample input format cringe as hell
> (The entry is wrapped here to two lines so it fits; in your notes, it will all be on a single line.)
i just yolo'd my part 1 without testing
i fucking hate it
166/help
05:09
like
make it fucking consistent???
@lyxal which means i have to use more effort to actually test it
so you can actually test it??? like who the fuck cares if it runs off the screen
> some careful analysis
anyway today was a hard diff spike holy shit
05:11
for p2 i just replaced "|\r\n" with "| " using my text editor lol
because p1 i was fairly confident i didn't mess up
but p2 i decided to test
I'm quite confused about how to do p2 aside from bruteforcing
my p1 was already quite slow, i'm kind of annoyed with myself for even trying to fix the input because i lost a lot of ranks on that
oh boy I actually need to use onenote and my apple pencil for once
I figured out how to get segment a
But I'm not sure where to go from there
Wait...
3's the only one of length 5 that contains 7
05:16
see i didn't bother trying to be smart
O(n!) brute force go brrr because n only equals 7 anyway
Oops
Oh well I will be smary
YES!
Okay frick this was hard
I got 60 for part two and my code was...clean
And well written
@hyper-neutrino I bothered being smart, I guess this is why I'm not successful in life lol
My solution was 55 lines long lol
Mine is 12
so far
Finally, 100 people have beat p2
05:21
@RedwolfPrograms Haha none of that here
for (let a of "abcdefg")
  for (let b of "abcdefg")
    for (let c of "abcdefg")
      for (let d of "abcdefg")
        for (let e of "abcdefg")
          for (let f of "abcdefg")
            for (let g of "abcdefg") {
...
lol
I figured out exactly which character was which using a bunch of really fun to discover tricks
what the fuck
at least i used itertools permutations
WIP tho
05:22
Honestly I'd rather do it the non-brute-force way, just 'cause it's so satisfying to see it all come together
Mine worked basically first try which was an extreme surprise
oh the non-brute-force way is definitely more satisfying
but it takes longer to think of and implement properly
Definitely
This is the first time I had to break out my text editor instead of doing it in the console
Also the first time I needed to use functions
Which means I can actually share my solution on GH! :D
Contains only a small amount of non-vanilla code
Actually the last line is the only one with library code in it, since I'd forgotten to make my library functions work with strings
i thought my very naive solution worked but it turns out i made a typo and it actually fails to terminate
almost done
@emanresuA You're guaranteed low triple digits
05:27
@hyper-neutrino Sorry, I guess it should be:
let x = [..."abcdefg"]
while(true){
  x.sort(() => Math.random() - .5)
...it doesn't even fail to terminate for the reason i thought it would
Finally finished: 660/431
even though it took me 5 times as long to do part 2 as part 1
Same for everyone, presumably
Part 1 was fairly trivial, part two was...not
05:31
(and my part 2 was using an ugly brute-force approach that took a measurable few seconds on the puzzle input)
166/486!
Damn, 486! is really high. I didn't know that many people did aoc
@tjjfvi Lol
I basically solved it analyically like a puzzle
05:32
I've moved up to 80 on the global leaderboard! :D
@emanresuA Same here, it was a lot of fun
What order did you figure out the segments?
@emanresuA vx is the segment corresponding to x (sorted to avoid confusion), sx is segment x
@RedwolfPrograms Read the code, it's basically showing my thinking process
Oh I ddin't even see that link lol
You did stuff a lot more elegantly than I did in a lot of places lol
just gotta figure out 2 and 5
I may have stolen 3 from you redwolf lol
05:36
No, not my 3! It's all I have left after the recession!
huh, I've found 2 ways of getting 6 and 9
nice.
Those were the hardest two for me
That is, the last ones I had to differentiate
6 is the only len 6 with the remainder of 4 - 1
i'm trying to brute force now and for some reason i'm having a hard time even thinking of how to sanity check an assignment lmao
(CC @RedwolfPrograms, don't read this @lyxal) thought process
05:41
@emanresuA no no I've gotten all the numbers
@emanresuA We had a very similar though process for the first half, but then we start doing things in a totally different order lol
in other news i really wish i'd read all of star 1 before writing out a list of all the segments lmao
didn't expect literally most of the input to only be relevant on star 2
It took me multiple minutes to read through all of part 1 and then I realized that yeah
I think most people did that, since I still did alright on part 1
oh main I can't wait to write up the smart way in vyxal
and that's /srs
it's gonna be beautiful with all its colours
06:09
i thought i actually thought of something but somehow it has 2 and 3 backwards on the one-line sample input and straight up errors on my actual input
...scratch that, it overwrites 3 with 2
ighto that's the number sorting done
now to actually determine the 4 digit numbers
i am taking my sweet sweet time with this one
bnecause i forgot to sort the damn things
of course
2199/3015 😎
the best part is that the segment list i wrote and couldn't use in part 1 wasn't used for part 2 eithe rbecause i just wrote the entire procedure by han
d
time for a game of will my vyxal finish in 60 seconds
and the answer is surprisingly yes
2648/3245
@emanresuA what do you think of ^
note that the conditions for 2 and 5 should be swapped
(^ is python's set xor)
(and some of those should just be - / .remove())
@emanresuA I will admit, underscore prefixed global variables made today way easier
06:29
WOO FIRST TRY
part 2 dun
@RedwolfPrograms how similar were our thought processes?
A bit closer than emanresu's, but I did 5/2 and 6/9 (nice) in the reverse order
I also did things a little more crudely, first finding all of the segments, then finding the numbers, instead of just finding all the numbers directly if that makes sense
But anyway, it's late here so o/
i tried to find the segments first but then realized i was relying on finding the numbers to find the segments
-- length 2: 1
-- length 3: 7
-- length 4: 4
-- length 7: 8
-- length 5:
--     contains all of 1's segments: 3
--     contains all of 4's segments that are not 1's: 5
--     otherwise: 2
-- length 6:
--     contains all of 1's and 5's segments: 9
--     contains all of 7's segments: 0
--     otherwise: 6
06:39
ooh i never thought of the 1 5 union
the code to implement this in haskell was...
not pretty
i can imagine
the difference between "sublist" and "subsequence" bit me
ahh :)
empty smile :)
and also the fact that the output values could be in a different order
 on‿fo‿se‿ei ← masks⊏˜2‿4‿3‿7⊐˜+´¨masks # 1,4,7,8  # Part 1 idea
  si ← ⊑{(ei≢𝕩)∧ei≡on∨𝕩}¨⊸/masks                    # 6: 1 and 6 combined makes 8
  fi ← ⊑{(ei≢𝕩)∧1=+´si≠𝕩}¨⊸/masks                   # 5: single place difference with 6 and isn't 8
  ni ← ⊑{(si≢𝕩)∧(𝕩≡𝕩∨fo)∧1=+´ei≠𝕩}¨⊸/masks          # 9: not 6 and single place difference with 8
  ze ← ⊑(6=+´)¨⊸/masks(¬∘∊/⊣)ni‿si                  # 0: not 9 and not 6 and contains 6 segments
  tw ← ⊑masks/˜{(se≢𝕩)∧4=+´fi≠𝕩}¨masks              # 2: 2 places not common with 5 and isn't 7
this was what i did
i really should have sorted everything in one pass at the beginning
find it really funny that 3 is the last one you get
06:47
completely manual solve lmao
all this to learn somebody got 6/5 by brute forcing it
i knew i wasn't gonna generate permuations so i just stuck with this
this is optimized for your given input, right?
oh all the fast people brute forced it
06:51
yeah it's relatively safe
yeah see
being smart takes time
brute force requires less thought
i've probably said this before but i get fast times by bypassing my brain and typing fast, not trying to find a more elegant / intelligent solution xD
if it's like, 2020d20 then sure i'll need to use my brain and at that point it's no longer a mad rush for a few seconds' difference
mm
funny thing is
But how would brute forcing actually work? Like obviously it involves all permutations, but then what?
06:59
if i had thought of brute forcing first then i totally would've done it
but i got so involved in figuring out the logic that i just committed
i tried to brute force like two different ways lmao
The left part contains any digit exactly once, so it always contains a specific segment the same number of times ("a" segment - 8 times, ..., "g" segment - 7 times).
Sum of these numbers of segments turns out to be unique value for each digit ("0" - "abcefg" - 8+6+8+4+9+7 = 42, ..., "9" - 45).
@lyxal idiomatic vyxal looks beautiful
07:17
for each remapping, you just sort each word and check if it's equal to {"abcefg", "cf", "acdeg", "acdfg", "bcdf", "abdfg", "abdefg", "acf", "abcdefg", "abcdfg"}
from itertools import *

t = 0

for k in lines:
    a, b = k.split(" | ")
    do = ["abcefg", "cf", "acdeg", "acdfg", "bcdf", "abdfg", "abdefg", "acf", "abcdefg", "abcdfg"]
    req = set(do)
    for x in permutations("abcdefg"):
        m = {i: j for i, j in zip(x, "abcdefg")}
        r = {"".join(sorted(map(m.get, q))) for q in a.split()}
        if r == req:
            b = ["".join(sorted(map(m.get, q))) for q in b.split()]
            b = "".join(str(do.index(q)) for q in b)
            t += int(b)
it works, so... :P
that hardcoding is funny
I approve highly
mhm
speed > elegance
i am not speed
08:24
@lyxal :)
@RedwolfPrograms Note: sa & sd are completely useless
@lyxal Looks pretty good :P
 
4 hours later…
12:37
Turns out I didn't even need to explicitly store segment A lol
 
4 hours later…
17:05
So I did it an interesting way
I didn't actually track segments at all
Just used logic and visuals to determine which number had to be which combination
@Razetime Oh, this is very similar to what I did
with open('input', 'r') as file:
    lines = file.read().splitlines()
    total = 0
    for line in lines:
        mapping = {}
        signals, output = [x.split() for x in line.split(' | ')]
        signals = sorted(signals, key=len)
        mapping[1] = signals[0]
        mapping[7] = signals[1]
        mapping[4] = signals[2]
        mapping[8] = signals[9]
        l6 = signals[6:9]
        mapping[9] = next(x for x in l6 if set(mapping[4]).issubset(x))
        l6.remove(mapping[9])
        mapping[0] = next(x for x in l6 if set(mapping[7]).issubset(x))
something cool i learned
you can do for line in open("input", "r") lol
Oh what
That's cool
yeah
and if you're scanning from stdin
Dec 5 at 5:33, by btnlq
open(0) doesn't need import
https://tio.run/##K6gsycjPM/7/Py2/SCFbITNPIb8gNU/DQNOKi7OgKDOvRCMHyM3W1Pz/PyM1JyefKz0/PyWpMpUrJz8HAA
so you don't even need to import sys and for line in sys.stdin, you can just for line in open(0) :D
17:35
@hyper-neutrino Does that auto-close it the way with does?
idk ¯\_(ツ)_/¯ probably not lol
 
2 hours later…
19:09
@lyxal Same, and segment d
19:23
oh yeah i tried using the iterating over stdin thing and something was weirdly off about it
can't remember what but ended up having to go back to iter(input,'')

« first day (6 days earlier)      last day (1132 days later) »