#advent-of-code

1 messages · Page 41 of 1

earnest forge
#

fetch() would need to pull and parse (and cache!) the puzzle page, and lazy_submit() would need to ignore the solution cache and web API to compare with the sample

#

Like I say, the architecture just isn't designed for that

sharp panther
#

What if you copied and modified the functions and put it into a different command-thingy? Maybe that's redundant, and I personally haven't seen the codebase, so I have no idea, but that's just a possible(?) thing.

earnest forge
#

I imagine you could probably get it to work by reading sys.argv for a --test or something but honestly I don't feel like sinking a lot of development time into a feature I'd never use

#

I'll happily merge a PR if you want to do it though

woven sable
#

Maybe add it as a feature in the off-season if you wanted to

earnest forge
woven sable
#

ohh it's OSS?

earnest forge
#

Yeah lmao

woven sable
#

awesome

#

i should've looked earlier 😅

earnest forge
#

literally a link to the source code

woven sable
woven oriole
#

morning guys ☕

woven sable
#

Sorry 'bout that

woven sable
earnest forge
#

Ahh np

#

you should try it 🙃

jade atlas
#

GM

woven sable
earnest forge
#

When you decide to use it do py -m aoc_helper template <day>

woven sable
#

gotcha, does that jut set up a template for a file?

earnest forge
#

It'll put in all the boilerplate for you

#

Yeah

#

It sets up the imports, the fetch, the functions, and the submit

void ocean
#

oh lol day 4 is in 30 mins

woven oriole
#

its some sort of CLI

void ocean
#

i better eat lunch

woven oriole
#

i better breakfast

minor cave
#

hmmmmmmm... do I be reasonable and go to bed now. Or just stay up late and regret?

final eagle
#

i dont feel like rushing today

woven sable
#

actually it depends

#

do you want to code while you're dozing off

woven sable
#

I have to wake up at 9 AM but 9 hours of sleep is perfectly reasonable so I'm gonna stay up

final eagle
#

heck even 7 hours is good enough for me

pseudo oyster
#

Whats Advent of code?

final eagle
earnest forge
jade atlas
#

so I heard the weakends are a bit harder?

woven sable
sinful pawn
#

There's something so satisfying about this tbh

rancid creek
#

The last weekend is typically harder. The other weekends are more on par, if they're harder it comes down to googling and problem solving.

woven sable
#

ah

minor cave
#

From Eric Wastl's Leetspeak 2019 talk, he talks about what goes into making each puzzle and how he tries to get the difficulty right, both for each individual puzzle and considering the progression overall

earnest forge
#

iirc I got mentioned in that talk (nope never mind it was the other one)

sinful pawn
#

"Weekdays vs weekends" 👀

hidden musk
#

👀

woven sable
#

👀

final eagle
#

how hard can it be /s

woven sable
#

inb4 "count the amount of sides in a fractal" /s

earnest forge
#

🙃

minor cave
#

During the talk he even mentions that for some of the part 1 vs part 2, his part 2 will purposely have a similar concept but then have a totally different set of requirements. To partially simulate the real world of a customer totally changing up requirements on you

woven sable
#

that sounds kind of like day 3

minor cave
#

He talks that some people can predict it (i.e. they can kind of see where it's going and build in flexibility to their part 1 solution, sometimes that means their part 2 takes literally less than 30 seconds) and others don't, so it takes longer for them to change their implementation

signal grotto
#

yeah I'm the second

potent pumice
#

i'm both

#

i'll either make something really flexible, or the most brittle solution ever to exist on my hard drive

signal grotto
#

ooh yes a little of that too

jade atlas
#

I usually can't break down backtracking problems easily and takes a lot of time for me. I wish there were some tutorials online that were interactive, because I have tried to watch some tutorials then immediately had some question but had no answer

minor cave
#

If you want to kill some time, I do recommend watching the first 8 minutes of that talk

hidden musk
#

watch the whole talk >:)

minor cave
#

It's very amusing listening to him recount the launch of Advent of Code back in 2015

#

"I'll predict that 70 people will be interested in this, my small server can handle that"
24 hours later: 9000 people have created accounts

earnest forge
#

DJ Khaled Suffering from Success

rancid creek
#

also stick around for the post aoc chat/stream after the season ends. generally a great discussion with good people.

minor cave
#

Screencap from the slide, which is 48 hours after the first puzzle releases in 2015

hidden musk
#

this person on the private leaderboard i have at school keeps staying up late to solve the problems, so hopefully today i can finish before him

#

and apparently f1re and nedbat are both beating me by 1 point

minor cave
signal grotto
final eagle
#

👀

signal grotto
#

i think i saw it last year while waiting for a challenge lol

minor cave
#

Discrete is UP THERE on the staff lb though

hidden musk
#

true, lx too

signal grotto
#

cries in 11th

minor cave
#

Also CR being staff this year @_@, competition is fierce

junior hinge
#

good morning people

hidden musk
#

pathfinding or conway's game of life 👀 for today

minor cave
#

alright, both my cats and my fiance are alseep. I should probably go sleep too since I have like 12 hours of research work to do tomorrow

#

good luck y'all!

signal grotto
rancid creek
#

Wait 20 mins so you can finish aoc first

minor cave
#

For those who are very fast and within range of leaderboard placement, please refrain from posting solutions until global fills~

junior hinge
steel oyster
#

Day 4 starts in 9 minnutes

hidden musk
quaint hare
#

it's only 9 minutes until next day now

final eagle
steel oyster
late frigate
#

gl everyone!

minor cave
#

Also, somewhat Soon ™️ we'll have an .aoc link feature, where you can associate your Advent of Code name with your discord ID. This will soon mean .aoc lb will automatically include your specific placement

#

Once we have the link feature I can officially announce the Advent of Code Finisher role

signal grotto
hidden musk
signal grotto
earnest forge
final eagle
#

well played

minor cave
woven sable
#

Pink!

hidden musk
woven sable
#

Like the code jam role

#

.color fuschia

hidden musk
#

ewwwwwwwww

woven sable
#

.color name Fuschia

hidden copperBOT
#
No colour match found.

No colour found for: Fuschia

woven sable
#

.color name Fuchsia

minor cave
#

haha, send me some hex codes and we'll see

hidden copperBOT
#
Fuchsia Blue

Color information for Name Fuchsia.

RGB

(122, 88, 193)

HSV

(259, 54, 76)

HSL

(259, 46, 55)

CMYK

(37, 54, 0, 24)

Hex

#7A58C1

Name

Fuchsia Blue

woven sable
#

this is the partner color i think

minor cave
#

This role will also have a role icon! So I need suggestions on that too

hidden musk
#

that's not fuchsia lol

potent pumice
woven sable
#

we should use the jam champion color

final eagle
#

.color #ffd1dc

jade atlas
minor cave
hidden musk
#

no we can't crowd the champion color

potent pumice
#

so all 50 stars, then

#

feels like there should be something for 25, since getting all 50 is hard

minor cave
signal grotto
hidden copperBOT
#
ffa017

Color information for Hex ffa017.

RGB

(255, 160, 23)

HSV

(35, 91, 100)

HSL

(35, 100, 55)

CMYK

(0, 37, 91, 0)

Hex

#FFA017

Name

No match found

narrow crown
#

advent of code in 5 minutes but i cant do it because essay :((

minor cave
jade atlas
#

That'll be some motivation tbh

tacit moss
sinful pawn
#

\😩 it's almost that time of day again

minor cave
hidden musk
#

getting 49 is difficult. the 50th is ez 👀

narrow crown
junior hinge
#

do you guys think todays gonna be harder than yesterday?

minor cave
jade atlas
#

let it stay until next year

narrow crown
#

i waste all of my time

woven oriole
#

20-25th days would have the epic ones

hidden musk
earnest forge
tacit moss
woven sable
junior hinge
narrow crown
north silo
#

AoC <t:1638594000:R> hemshake

hidden musk
woven oriole
#

less go

minor cave
#

Bad attempt at a joke, since I consider d2p2 to be one of the easiest stars to get and it would be amusing to be 1 shy of 50 stars because of the easiest star to miss

earnest forge
#

GLHF

tacit moss
north silo
#

Gird your loins.

tacit moss
#

then AoC after

earnest forge
signal grotto
#

Starting <t:1638594000:R>!

hidden musk
#

lol

minor cave
woven oriole
#

does anyone know how to fix an extra blank line being written while writing text in a file at the end

signal grotto
#

shh pretend i didnt mess up

minor cave
#

.aoc c

hidden copperBOT
#

Day 4 starts <t:1638594000:R>.

earnest forge
prisma sundial
#

another day, another chall

hidden musk
#

soon 👀

stray anvil
#

2 mins

earnest forge
#

GLHF everyone

woven oriole
#

my inner feelings are telling me to not read the story just head straight to the sample input

stray anvil
#

same

woven oriole
#

:awkward_child:

signal grotto
minor cave
stray anvil
#

got a tab open just for the day4 input

woven oriole
#

this

jade atlas
woven oriole
#

lmao

#

but still somehow reading it important

stray anvil
#

not reading the story just feels incomplete

earnest forge
#

I tend to read the story after day 25

woven oriole
#

thanks for reminding

steel oyster
#

< 1 min

prisma sundial
#

just skip to the numbers are start reading from there

minor cave
hidden musk
#

read story after you solve the problem

junior hinge
#

cya guys in 10 hours or something

tulip elbow
#

hf

jade atlas
#

okay 30 secs

woven oriole
#

.aoc c

hidden copperBOT
#

Day 4 starts <t:1638594000:R>.

prisma sundial
#

gl everyone, something tells me i wont be beating my global 13 today

signal grotto
#

good luck!

tacit moss
#

Refreshing is fun

woven oriole
#

15

hidden musk
#

focus up

jade atlas
#

good luck everyone

tacit moss
#

the changing ASCII art

woven oriole
#

LESSGO GUYSYSYYS

steel oyster
#

gl everyone

potent pumice
#

hi lance, tell us something we already know! 😛 /s

woven oriole
#

gl

hidden copperBOT
minor cave
#

mmmmm, sweet sweet silence

potent pumice
#

someone said that should post a few minutes early

tacit moss
#

That is some ugly input

signal grotto
#

ehh nope i'll try this tomorrow, this is too complicated for my tired mind

#

good luck with bingo yall!

placid lake
#

i just got homeee

narrow crown
#

too bad i cant do this

placid lake
#

i don’t have the energy to do this right now

#

bleh

#

it’s midnight

potent pumice
#

same

potent pumice
stray anvil
#

ok im def losing

stable heron
#

gosh

#

oh gosh

quaint hare
#

day 4 question is released

stable heron
#

yes

#

wait

quaint hare
#

Day 4: Giant Squid

stable heron
#

what?

placid lake
#

i’m gonna pass out

#

goodnight

#

good luck

outer chasm
#

man..

quaint hare
#

day 4 continues the submarine story

#

cool

tacit moss
#

I am appalled by how quickly people finish these things

prisma sundial
#

oof

hidden musk
#

😩

#

finished part 1 now waiting on wrong answer count down

prisma sundial
#

made a tragic mistake in pt1 that set me back 60s

#

rip

dim oracle
#

wtf is part 1

steady berry
#

oh no i forgot abt this whole thing

potent pumice
#

make an issue on lance's repo 😛

late frigate
#

Damn ppl are fast for this

steady berry
#

im eating now

#

prob play later

next shell
#

two days in a row I got ~350th on part 1 but snuck in top 300 for part 2

#

head to the spoilers channel if you want some help

sinful pawn
#

I think I hate this ._.

velvet knot
#

;-;

steady berry
#

when you dont know how to play bingo :(

stable heron
#

done 😌

steady berry
#

oh i think i got it

#

doing it on my phone now :)

sinful pawn
#

I hate this >:(

earnest forge
#

I literally spent 20 minutes debugging because I'm a dumbass who made a trivial mistake

hollow wharf
#

day 4 time >:3

vestal breach
#

can anyone give me input plspls

quaint hare
prisma sundial
#

nice i gained a rank on python leaderboard even with my slowish performance today 🙂

ivory ravine
#

fuck me my solution works on the example

#

but it's wrong

#

and i have no idea why

quaint hare
#

4, 4-5-6666

vestal breach
earnest forge
#

List-comps and the int constructor

velvet knot
#

Finally beat prt 1 holy crap

wary wigeon
#

how's day 4 everybody?

sinful pawn
#

omg this is so dumb

earnest forge
#

I was a dumbass and wasted 15 minutes on part 2

wary wigeon
#

what is it?

#

i haven't read it yet

earnest forge
#

Bingo

sinful pawn
#

stupid bingo

quaint hare
#

it's squid game

wary wigeon
#

bingo?

#

wdym

#

lol what

sinful pawn
#

who on Earth invented this stupid game

quaint hare
#

the squid game is bingo

earnest forge
#

Playing bingo against a giant squid

wary wigeon
#

ah

quaint hare
#

a squid plays bingo

wary wigeon
#

sounds stupid

quaint hare
#

lol

sinful pawn
#

I literally hate this so much

ivory ravine
#

diagonals don't count

#

god fucking dammit

sinful pawn
#

I hate working with this stuff

quaint hare
#

what

quaint hare
wary wigeon
#

woaaaaah

#

why is the input so huge

quaint hare
#

idk how to match diagonals

sinful pawn
#

this is so frustrating lemon_angrysad

quaint hare
#

last day was 1000

wary wigeon
#

what are these numbers

earnest forge
quaint hare
#

read the question first

ivory ravine
#

yeah i did the diagonals and then spent 20 minutes figuring out why my solution didn't work on part 2

sinful pawn
#

what

ivory ravine
#

it worked on part 1 by accident

quaint hare
sinful pawn
#

I can't even do the damn columns

#

How do you even accidentally do diagonals

quaint hare
timber glacier
#

just got 2576 on the sample input instead of 1924 on part 2

sinful pawn
#

I... can't

earnest forge
quaint hare
earnest forge
#

Lmao

quaint hare
#

I'm here for a while

sinful pawn
#

eeeee

quaint hare
#

idk what to do next

sinful pawn
#

I hate this so much man

#

this is so dumb lemon_angrysad

#

rip. back to quitting

#

I can't do this

dim oracle
#

i cant solve these now

#

i got the first 2 days

#

and the first part of day 3

#

now i cant do it

#

how should i improve my problem solving skills to be able to do this

timber glacier
#

yess got it to work

hollow wharf
#

:3

#

i have all the boards split now

#

now i have to define the win condition and figure out which one wins first

sinful pawn
#

I don't understand how y'all do this

hollow wharf
void ocean
#

I spent way too much time on part 1

sinful pawn
#

I literally have like no way to really do part 1 except the really long way

dim oracle
#

i have a 3d array for this

sinful pawn
#

and I refuse to do that

void ocean
#

the short way is numpy

hollow wharf
dim oracle
#

show in spoilers channel?

sinful pawn
void ocean
#

sure

outer chasm
#

my code is so ugly

dim oracle
#

thanks

sinful pawn
#

welp

#

This is where I truly give up

#

day 4 as compared to day 9 last year

stable heron
sinful pawn
#

luxuries of a Python programmer -_-

quaint hare
#

yeah so many build-in stuff

hollow wharf
#

er-

#

my code looks kinda sus-

#
boards = [{"Board": x, "Marks": starting_marks} for x in boards]
#

:3

stray anvil
#

same

twilit gorge
#

i hate aoc damn 😂

stray anvil
#

my board-getting mechanism is literally a 300 char long list comprehension

hollow wharf
#

||boards = [x.strip() for x in data[1:] if x.strip()]||

#

that's what i have

#

¯_(ツ)_/¯

stray anvil
#

what is strip

hollow wharf
#

uh

#

!strip

marsh currentBOT
#
Did you mean ...

string-formatting
f-strings

stray anvil
#

is this a gem i missed

hollow wharf
#

bruh

steady berry
#

!d str.strip

marsh currentBOT
#

str.strip([chars])```
Return a copy of the string with the leading and trailing characters removed. The *chars* argument is a string specifying the set of characters to be removed. If omitted or `None`, the *chars* argument defaults to removing whitespace. The *chars* argument is not a prefix or suffix; rather, all combinations of its values are stripped:

```py
>>> '   spacious   '.strip()
'spacious'
>>> 'www.example.com'.strip('cmowz.')
'example'
```  The outermost leading and trailing *chars* argument values are stripped from the string. Characters are removed from the leading end until reaching a string character that is not contained in the set of characters in *chars*. A similar action takes place on the trailing end. For example:
hollow wharf
#

well

#

that

#

lol

#

yeah

stray anvil
#

bye

hollow wharf
#

lol-

steady berry
#

i dont want to do today's challenge

#

._.

stray anvil
#

i spent 1 whole hour on that list comprehension

#

and it turns out

hollow wharf
#

im dealing with it rn

stray anvil
#

same

#

the example works, but the input doesnt

hollow wharf
#

well uh

#

everything depends on what you did so far

#

:3

stray anvil
#

another way of saying, "you'll win if your code is good"

velvet knot
#

cannot believe I am stuck

#

It works for test case but fails the real data

stray anvil
#

literally woke up at 6 am just to fail

earnest forge
velvet knot
#

hmm

#

i must be doing something wrong

#

thanks

void ocean
#

My solution for part 2 is || removing the boards returned by part1 iteratively until only one board is left || but it's not working for some reason

earnest forge
#

Make sure you don't forget to check boards after the first not-winner, I didn't 🙃

ivory ravine
signal grotto
#

hey this one actually wasnt as stupid difficult as i thought

tulip elbow
#

i blocked myself by initially setting all of the called numbers to 0 on my bingo cards

#

not realizing that the cards can have values of 0 in them

hollow wharf
void ocean
#

it's giving an answer though

hollow wharf
hollow wharf
#

why not?

void ocean
#

WTF diagonals don't count

hollow wharf
#

nah

void ocean
#

smh

#

this is not real bingo

earnest forge
void ocean
#

nah just a simple check

jade atlas
void ocean
#

bruh accounting for diagonals gave me the wrong answer

earnest forge
# void ocean nah just a simple check

I mean it literally contradicts the question text but ok all right technically it doesn't state that but ||you can't put numbers on a card if they aren't in the selection||

winged pond
#

damn I only now finished part 1

#

that's what I get for doing it in rust

stray anvil
#

ok i found the mistake

hollow wharf
stray anvil
#

literally typed if_all_trues instead of is_all_trues

earnest forge
hollow wharf
#

What if a board has numbers that are never called?

#

or did they mention that can't happen lemon_thinking

earnest forge
#

I read the problem text as 'all numbers are permuted to form a draw order, and 25 of them are picked at random for each board'

gritty cedar
#

How is the leaderboard score calculated? nvm

wary wigeon
#

fuck day 4

#

bye.

gloomy kernel
signal grotto
woven oriole
#

huh

#

finally done

stray anvil
#

finally

signal grotto
#

nice!

junior hinge
#

im stuck but i dont wanna look at the spoilers channel :/

signal grotto
#

try doing some debugging, even if that means just throwing in random print statements, usually gets things flowing again

#

if you've learned about typehinting, I recommend using it for these, it helps to keep track of which variable has what type

junior hinge
#

its the logic that im having issues with 😮

#

i got every row in its own list inside a list now, but i think i need to make 5 and 5 of those rows into separate lists. so they become individual boards.

quaint hare
#

what is this pattern

onyx plank
#

helloooo, im doing the problem too and I'm having problems debugging, does anybody know which board is supposed to win so I can keep an eye on that one?

hollow wharf
onyx plank
#

i fucking love it lmao

hollow wharf
#

or the inputs are probably different at least lirikHMM someday we should all test

onyx plank
#

time to go bang my head against a wall, it works on my example but not my actual dataset lol

devout tusk
#

I don't think i understand part 2. ||why exactly did he choose 13 and stop? logically "figure out which board will win last" should mean the last drawn number, right?||

wild crypt
#

it's getting harder with each day 😩

hollow wharf
onyx plank
devout tusk
quaint hare
#

cool

signal grotto
quaint hare
#

whoever made these questions spend a lot of time in them

signal grotto
quaint hare
#

hard work

sonic silo
jade root
#

wow my solution for day 4 is EVEN jankier than yesterday XD

quaint hare
#

day 4 is literally squid game

sonic silo
#

wtf

jade root
#

lol

hollow wharf
devout tusk
wild crypt
unique osprey
#

My list of numbers to draw will be frontman

junior hinge
#

this is how far i've gotten. i got every row in the inputfile into seperate lists inside a list. im stuck now ;O

hollow wharf
# junior hinge

small visualization helper, do ```py
from pprint import pprint

...

pprint(grid)```

junior hinge
#

ty

onyx plank
#

i can tell you that as somebody who isn't great at programming

#

this shit is better than sex ^^^

frank maple
#

nice, my code is very ugly but worked

onyx plank
#

same bro

#

87 lines of pain lol

frank maple
#

i think it has to be like some of the ugliest of the functioning solutions. i feel like it should go into some type of modern art exhibit

woven oriole
quaint hare
#

what

#

are you a insider who knows the questions

woven oriole
#

👀

#

i use vscode insiders

quaint hare
#

🤨

jade root
quaint hare
quaint hare
onyx plank
spring heron
#

The fun of AoC is solving the problems, and all the fancy vis people come up with anyways

#

Having terrible code is part of the game™️

woven oriole
jade root
spring heron
#

Hey, as long as you can submit your solution in december, it's all fine

woven oriole
#

TOOK COMPLETE 1 SECOND FOR VSCODE TO display the INTEGER lmfao while execution

woven oriole
#

yeah , jk

quaint hare
#

you just need the answer

#

and the star

onyx plank
#

also i have a question:
let's say i have a variable x and a variable y where both are lists equal to each other through

x = y

If i run the below code, does it also get rid of the same index on x?

y.pop(some index)
#

because for some reason i was having one variable that was never even touched being changed

woven oriole
#

lists are mutable

frank maple
#

in 2019 some of my programs were running for like 8 min because they were so inefficient

woven oriole
#

so yes it will get popped from both

spring heron
#

The nice thing about python is you can just check things like those yourself pretty easily

woven oriole
#

!e

x = y = [1,2,3]
x.pop(1)
print(x,y)
marsh currentBOT
#

@woven oriole :white_check_mark: Your eval job has completed with return code 0.

[1, 3] [1, 3]
muted pivot
#

don't mind me, just relaxed after clearing some bugs

woven oriole
#

!e

x = [1,2,3]
y = x.copy()
x.pop(1)
print(x,y)
marsh currentBOT
#

@woven oriole :white_check_mark: Your eval job has completed with return code 0.

[1, 3] [1, 2, 3]
woven oriole
#

@onyx plank

onyx plank
woven oriole
#

exactly

#

its all references

onyx plank
#

fuck

woven oriole
#

whenever you mess with mutable , remember shits gonna reflect everywhere xd

#

lol

onyx plank
#

okay is there any way to specify that i wouldn't want to let it reference and have it actually copy the variables into a new place?

woven oriole
onyx plank
#

hmm okay

#

ty!

woven oriole
#

but i think copy is enough

onyx plank
#

that was tripping me up when i was doing part 2 bc usually i just copy paste everything so i can isolate my code for both parts a bit

woven oriole
#

yeah that happens

quaint hare
#

!e ```py
couples = [[0,0]] * 5
couples[1].append(7)
print(couples)

devout tusk
#

finally done. part 2 was actually quite easy

marsh currentBOT
#

@quaint hare :white_check_mark: Your eval job has completed with return code 0.

[[0, 0, 7], [0, 0, 7], [0, 0, 7], [0, 0, 7], [0, 0, 7]]
quaint hare
#

this shit lost me a whole hour yesterday

quaint hare
#

to part 1

outer chasm
#

Damn today nearly killed me

devout tusk
quaint hare
#

me too

devout tusk
onyx plank
outer chasm
jade root
#

frick i went down to 64

junior hinge
#

😮 now let the fun begin wooho (hopefully this is manageable with this datastructure)

bright spindle
quaint hare
#

yeah it's written that

Even if it's hard one day, the next day might be easier, so don't give up!
#

.
help

#

my name is not in the board

jade atlas
#

How come I am 11 on the aoc leaderboard, but here I am 71st

quaint hare
#

if you just summited a answer, it isn't updated yet

jade atlas
quaint hare
#

idk then

#

my name is not even in the leaderboard for some reason

winged trellis
#

morning 😄

quaint hare
#

hi

winged trellis
#

my part 2 is successful with the test data but fails with the real data

winged trellis
quaint hare
#

thats bad

winged trellis
#

there is a limit on how many can be in one aoc leaderboard

jade atlas
quaint hare
winged trellis
quaint hare
#

I completed 3 parts

winged trellis
quaint hare
#

how to join

#

okay

winged trellis
#

there is a join command there

quaint hare
#

oh yeah I see

hollow wharf
#

wow doing today's was brutal for me

#

funnily enough, I thought that checking if a board had won would be hard

#

that was a piece of cake

#

but actually running the games was death

sonic silo
#

checking if a board had won is a oneliner

hollow wharf
#

well mine is 3 lines but it's just like that for semantic clarity

hazy pendant
#

i saw day4 using bingo

#

oh god

#

no

#

nk

#

no

#

oh god no

outer chasm
#

good luck 🙂

hollow wharf
hazy pendant
#

parse all the input

hollow wharf
woven oriole
#

the fall of day 4

sonic silo
#

lmao

atomic frost
#

well it is early in the day

#

more people will do it later on

woven oriole
#

well yeah

hollow wharf
sonic silo
#

or not

#

maybe this is indeed the big first wall in this year

#

last year it dropped heavily on day 7 and 4 at first

#

iirc

woven oriole
#

👀

hollow wharf
#

I mean

#

this is not a hard problem

#

it's an annoying problem

#

but it's not technically hard

atomic frost
#

yeah they are all do what i say problems so far

sonic silo
#

thats what these problems are

hazy pendant
#

i finished only the parsing part and it took 288 bytes for main.py

hollow wharf
#

noooooooo later problems often require cleverness

atomic frost
#

no but like for example day 10 last year you would have to optimise or it would take forever

sonic silo
#

hmm

hazy pendant
#

to emulate

#

recursiom

hollow wharf
#

yeah. here if you just read the instructions and implement the naïve solution, it works

sonic silo
#

in y2020 d23 p2 (iirc) you had to get a bit clever to reduce time complexity a lot

atomic frost
#

yeah you just have to translate between english and code

hollow wharf
sonic silo
#

or not if you used arrays from the get go

atomic frost
#

but later you have to be clever

hazy pendant
#

right

#

lmao

hollow wharf
#

hashmaps go brrrrrrr

hazy pendant
#

brrrrrrrrrrrrrrrrrrrrrrrrrr

ivory venture
hollow wharf
#

idk how hashing actually works in the language that I'm doing AoC in

hazy pendant
#

use google

hollow wharf
atomic frost
#

yeah there are lots of nicer solutions etc but a working one for these will just be the naive solution

hollow wharf
ivory venture
hazy pendant
#

oh cmon boards is a 3D

ivory venture
#

It doesn't have to be super smart though yeah

hollow wharf
atomic frost
#

but mostly if you are the right time complexity it should work

hollow wharf
#

well anyway done solving today's problem time to go do drugs yeet

ivory venture
#

Don't listen to him kids

hollow wharf
#

uh yeah

#

don't do drugs

#

bad

hazy pendant
#

last year was kind of a moderate challenge
but now even day4 is competence simulator

hollow wharf
#

last year's day 4 was just parsing hell lol

ivory venture
#

Yeah the difficulty rose more sharply this year I think

hollow wharf
#

iirc it wasn't really even a hard problem, just the parsing was a nightmare

ivory venture
#

But we'll see

hazy pendant
#

either the creator got smart or the quarantine changed everyone

hollow wharf
#

ahahaha

#

as someone who does a fair share of teaching, it can be very difficult for someone with a lot of experience to gauge how hard a problem is

hazy pendant
#

bingo? more like bingo for your brain

atomic frost
hollow wharf
#

urgh my code for today is like 100 lines

#

actually it's only 51LOC

#

the rest is comments and whitespace

#

so that's not too bad

#

actually that's similar to my solution for yesterday's

mossy basin
#

note that this is a weekend problem and they tend to be more difficult

sonic silo
#

^

craggy wraith
#

😮

hollow wharf
woven oriole
#

the #1 guy did it in 4 minutes

#

👀

hollow wharf
#

wow Robert did it in 5:30

#

can't believe how good that guy is lol

tight dune
#

havent sen the problem yet

hollow wharf
#

great teacher too

tight dune
#

class 😔

#

my rank going to be trash

tidal beacon
#

Can there be duplicates in a bingo board?

#

Also is this a 2 part as well?

hollow wharf
hollow wharf
tidal beacon
#

ty

proud cosmos
#

Today was quite nice

rancid creek
rancid creek
quaint hare
#

is it possible to change my change my name to something else outside the anonymous user name and my google name

junior hinge
#

woohooo

#

i take every small victory, a little break before i open part 2 now 😄

#

:DDDDDDDDDDDDDDD

hollow wharf
winged trellis
junior hinge
#

this time with a timer so i can take a 5min break every 30min and stretch thisbody

winged trellis
#

was also stuck on part two, i had an off by one error, thought i removed the winning board, but removed the winning board +1 isntead

junior hinge
#

could i ask a question about part 2 here? just the logic. i dont wanna open the spoilers channel before im done

winged trellis
#

so instead of ||removing the board|| i just set it to ||None'|| and it worked out well

winged trellis
#

ask and include spoilers for anything that is spoilery

tidal beacon
#

Honestly today part 2 was just a little modification for me

#

I thought its gonna be a project after part 1, but it was alright

#

@winged trellis could I ask to see your code 😄

tidal beacon
winged trellis
tidal beacon
tidal beacon
winged trellis
#

nope, its in my advent of code repo

#

2021 branch

rancid creek
#

203!

tidal beacon
winged trellis
#

the list version is my rewrite

tidal beacon
#

day4.py is like reading a different language to me lol

winged trellis
#

the use of ||dataclasses|| was never really needed

#

but i imagined a harder part2 and felt having the details || in a class|| would help me out

rancid creek
#

202!

tidal beacon
#
numbers: ClassVar[list] = []
board: list[list[Number]] = field(default_factory=list)

no clue what is going on here haha

#

yea ill check out your rewrite

winged trellis
#

weekend puzzles are more challenging then weekdays, so i expected it to be much harder

tidal beacon
#

what is the first line tho

#

actually 2nd line too

#

the name and :

winged trellis
#

its the syntax you use when you make a || class attribute using dataclassess||

tidal beacon
#

okay so look into dataclasses, got it

#

just cuz im curious

winged trellis
#

start by going to the python docs about the topic

#

its a rather new feature of python, only been around a few years

tidal beacon
#

start = perf_counter() is this to test run time?

winged trellis
#

end - start gives you the correct time

tidal beacon
winged trellis
#

first version 0.13, list version 0.02

tidal beacon
#

.02

#

thats a Pog

#

mine is .13 too but I wouldnt know how improve it too much by myself

#

thats a neat code

winged trellis
#

no real need to optimize something that takes a fraction of a second to run 😄

#

we are really just running it once to get the answer

tidal beacon
#

numbers, *boards = f.read().split('\n\n') what happens here?

#

how come you have 2 variables on the left? not sure if calling it a tuple in this context is right

winged trellis
#

its unpacking

#

the right hand side is a list

loud yew
winged trellis
#
a, b, c = [1, 2, 3]
tidal beacon
winged trellis
#

this will unpack the three values on the right into the three names on the left

#

but if you dont know how many values you have on the right, you can pack the rest into a name by adding a star

#
first, *the_rest = [1, 2, 3, 4, 5, 6]
tidal beacon
#

ah

winged trellis
#

first will have the value 1 and the_rest will be the list [2, 3, 4, 5, 6]

tidal beacon
#

I did not know the unpacking thing here

winged trellis
#

so what im doing is getting the first line of the file and the rest

tidal beacon
#

this is some big brain splitting

#

Every time I think im decent, u guys pull tricks out of your ass that I never saw before. Its great

winged trellis
#

python has a lot of tricks, its wise to pay attention during AoC to grab a few tricks 😄

tidal beacon
#

gonna take a lot at dataclasses and itertools chain now I guess

loud yew
tidal beacon
winged trellis
#

my pleasure

restive imp
#

omg... the record for day four is less than 5 minutes. That's embarassing

loud yew
#

holy

hollow wharf
#

Hello, I wanted to know if one can resubmit the code if it goes wrong.

#

Can we?

restive imp
#

you don't submit the code, only the result. But yes, you can re-submit

hollow wharf
#

There's a submit button near the empty space. That's why I asked, but thanks!

restive imp
#

yes, after you hit that it will tell you if you were right or wrong, but you can try again

hollow wharf
#

I see. Why is it so small, anyway? All code goes in one line and looks uncomfortable

restive imp
#

not code, only the result
Most of the time you will be asked to find/calculate a number.
That number goes into the submit form

hollow wharf
#

Oh, thanks for the clarification. I had believed that we need to enter the code, but that's fine.

hazy pendant
#

I FINISHED PART2 DAY4 2021

#

part1 was kind of easy but part2 made me think of my life decisions regarding ||returning a int instead of a list||

restive imp
#

It took me forever for part one, but luckily it included the result for part 2 as well 🙂

humble escarp
humble escarp
hazy pendant
#

it's a crack of relief

marble minnow
#

hey, is this the right place to ask for help in solving advent of code?

#

or are you just discussing it here

marble minnow
#

oke

#

tyty

outer chasm
steady berry
#

can i play day 4 if i don't finish day 3

low condor
loud yew
#

PART ONE DONEEEEEEEEEEEE WOOOOOOOO

junior hinge
#

I did it, but my code is a god damn mess on 100 lines + 😄

quaint hare
#

100+?

junior hinge
#

102 ;O

quaint hare
#

and I though my code is big

junior hinge
#

i got a lot of teststuff init tho

quaint hare
#

then remove those to make it small

#

my day4 part2 is 20 lines

west summit
#

how did everyone find part two of day 3 ?

wary wigeon
#

it was good

west summit
#

take you much time ? I got part one , part two seems you need put more time into it or is it fine ?

hazy pendant
#

weekends are usually harder than non-weekends

west summit
low condor
wary wigeon
#

my code were doubled

west summit
quaint hare
west summit
wary wigeon
#

there is no gamma and epsilon anymore in the part 2

west summit
wary wigeon
#

you could but they're not g & e anymore
they're ocr and csr

west summit
#

oh okay

#

how do you get more score ? is it based on how fast you do it ?

hazy pendant
#

alright i have a bad joke
||advent of code||

quaint hare
#

it's bad

loud yew
quaint hare
#

how is that a joke

hazy pendant
#

||read the bold text||

hazy pendant
quaint hare
exotic geyser
#

man this is doin my head in

#

I have what feels like the right answer but apparently not and i cant figure out why

hazy pendant
#

check your code using the example

exotic geyser
#

what example

#

ohhhh

hazy pendant
#

the example from the website

exotic geyser
#

yh yh

#

i did and as far as i can tell im fine, imma go through it one more time....

#

oh im so done

pale heath
#

In day 4 (part 1) if I had drawn 6 numbers and there is no winner, then I draw 7 numbers and so on or it needs to end at 6?

final eagle
pale heath
final eagle
#

basically, for every number u draw, u check if a winner exist at that number

pale heath
final eagle
#

it is just trying to demonstrate to u how bingo works

pale heath
#

so you just do 1, 2, 3, 4 and so on?

final eagle
#

just cross out numbers on each board successively

loud yew
#

I FINISHED PART TWO YAYYYYYY

sleek cave
#

bro how do aoc puzzles escalate so quickly lmao

#

sigh, if only I knew how to manipulate matrices and use numpy... guess I'm going the primitive route

sonic silo
#

this happens during the weekends

#

from 1 to 3 it didnt escalate that hard

low condor
#

After having to downgrade from 3.10 to 3.9, because pytest + PyCharm was giving me Windows memory errors during debugging, I finally have done Day 4

low condor
#

Also

#

Love the Star Wars reference today

smoky vapor
#

.aoc countdown help

hidden copperBOT
#

Day 5 starts <t:1638680400:R>.

pale heath
#

Do someone know what they mean by last win?

#

because when I just add all "wins" to list and print last entry it doesnt give right answer

low condor
#

Do you want to share code? Maybe worth talking in the spoilers channel

frigid zephyr
low condor
#

Hover over the text where it says to let the giant squid win

#

There's some hover text there that confirms it

frigid zephyr
#

ah that's cool

low condor
#

Mhmm - got it instantly lol

sonic silo
#

||there's lots of references in AoC, you should try to find em||

low condor
#

In addition to this ||if you get all 50 stars it highlights where all the secret references were||

#

Though you can just ||look at the HTML|| if you want to bypass that lol

sonic silo
#

lol

drifting saddle
#

In the 2nd part of Day 4.
||It is written that the 2nd board will win at last, and the total of unmarked numbers is 148.
But how it is 148 ?
as it wins when 13 number called.
So, numbers which are unmarked are:
6,15,25,12,22,18,20,8,19,3,26,1, and it's sum is 175 .
But it is written 148 there, how ?||

low condor
#

you should move this to the spoilers channel

mighty goblet
velvet stag
drifting saddle
hollow wharf
#

my soluto for part 1 is currently 28 lines

#

is this bad

sonic silo
#

the worst ive seen is 100+ lines

signal grotto
#

i wouldn't say that's bad, sometimes it's better to have longer code so its more legible

hollow wharf
#

yeah, thats been what ive been tryng to do

sonic silo
#

mind you that an answer to this day is perfectly legible with 30 lines, and 100 lines is ridiculous for one single part lol

#

(if we count reading/printing/imports that's 45 tho, in my personal case)

bleak sable
#

I haven't had time nor motivation to check the current task yet. From the messages above it seems it's easy to overthink it?

hollow wharf
#

and yeah it seems like it

narrow crown
#

im gonna catch up on the stuff i havent finsihed today lol i had so much hw

hollow wharf
#

i abandoned almost all of my code and FUCK

#

omg i just realised how mcuh ive complicated things

sonic silo
#

?

hollow wharf
#

||i converted everything into a list, and then all of that into ints, when really i could've just replaced parts of it as a string||

sonic silo
#

is it really gonna be better like that?

hollow wharf
#

||yes||

frigid zephyr
warm berry
#

Whew....just finished day 3 part 2 lol. I think I'm already lagging behind

humble copper
#

for day 4 part 1 are we meant to assume that numbers are being drawn 5 at a time?

#

or one at a time

ivory venture
humble copper
#

ok thanks

ivory venture
#

Just to clarify, you draw numbers from the first line in the input. The rows of 5 are your boards

woven sable
humble copper
#

ok

woven sable
#

i'lll probably learn it after AoC is over

ivory venture
#

numpy is magic

humble copper
#

bc the problem description does them 5 at a time so i thought we had to do the same

woven sable
#

I saw people complete it in so little lines

ivory venture
humble copper
ivory venture
#

Ah no, they're just fast forwarding to this position

humble copper
#

ok that makes sense

ivory venture
# ivory venture numpy is magic

numpy's slicing is one of the best things introduced to Python by a third party library, although I understand that it might not fit in the general case, as numpy arrays have specific shapes

junior hinge
#

maybe we could have some live workshop with numpy on this discord after AoC ? :))))

ivory venture
#

I'm considering it honestly, I doubt I'll have the time though 😅

junior hinge
#

sometimes the thought is all that matters

unique remnant
#

and seeing other people's solutions helps you get to know about new functions you can use

sonic silo
#

documentation moment

timid kraken
#

So for the inputs of aoc puzzles, how do i store hundreds of them in a list?

unique remnant
#

docs are a bit hard 😭 but yeah it always helps trying to read them

sonic silo
#

devdocs has numpy :o

junior hinge
unique remnant
#

:o I didn't see those. I just jumped straight to [function I needed] doc page

sonic silo
#

documentation isnt just documentation of the code

#

good documentation will generally have a nice quickstart through which you can get the feel of the library, and from there you can branch out

#

i wish the idea of hoogle was more extended (function lookup based on function signature)

hollow wharf
#

im cosidering giving up or cheating

#

im so stuck

sonic silo
#

thats bad

#

take a break

hollow wharf
#

ive been trying on and off for like an hour

velvet stag
#

that's good

mint hornet
#

How long did day 4 part 1 take for y'all?

drifting saddle
sleek cave
#

damn

drifting saddle
#

and now stuck in part 2

sleek cave
#

i'm going to start 4.1 now

drifting saddle
#

don't know how to do it

humble copper
#

d4p1 is much harder than the last ones lmao

hollow wharf
#

i am happy that i restarted it 5 minutes ago

sonic silo
#

hmm

#

some of these days i should do in gnuplot

hollow wharf
#

ive managed to set up everything in 3 lines, before it took me 8

hollow wharf
mint hornet
#

I wonder how hard day 25 problem will be shipit

hollow wharf
sonic silo
#

all day 25s are easy cause its christmas

#

just a lil dessert for the finish line

humble copper
#

wait for day 4 part 1 do we assume that no number appears on the board twice

signal grotto
#

I'd think so

hollow wharf
#

Yes

loud yew
hollow wharf
#

Not really no

#

It gets harder with the time, no exceptions

sonic silo
#

have you played other years

#

lol

#

2020 was simple, 2019 was literally a videogame that was already made for you in intcode

#

you just had to play it

sleek cave
#

when even parsing the input becomes a pain in the ass, you know shit's 'bout to get fun

#

don't-know-how-to-use-numpy moment

sonic silo
#

2017's was a turing machine and very reminiscent in difficulty to the first 5 days

woven oriole
sleek cave
#

lmao

deep ferry
#

do everyone have the same input?

sleek cave
#

yep

mossy basin
sonic silo
#

you dont need numpy to parse this...

mossy basin
#

input is different

sleek cave
#

oh nvm

#

lmao

mossy basin
#

numpy does parse it fast

sonic silo
#

it is made simpler with numpy but its not that bad in vanilla import-less python

sleek cave
deep ferry
woven oriole
#

wait
input different means answer different 👀

sleek cave
sonic silo
sleek cave
#

AMAZING

shrewd osprey
deep ferry
woven oriole
#

didn't think that the website will have to handle different outputs as answer from like thousands of people

sonic silo
#

yknow

#

thats funny, in 2015 you had to use md5

deep ferry
woven oriole
#

correct

deep ferry
#

wonder if it's server side or client side

woven oriole
#

they have randomized input + decides the output using their predefined code , i sus

deep ferry
#

hopefully server side

mossy basin
#

there's a set number of unique inputs --- say, 100 and you'll get one of those

shrewd osprey
sonic silo
#

ok but thats not aoc-related

deep ferry
#

as long as it works

#

it works

#

because part of cryptography is written in rust

shrewd osprey
deep ferry
#

and i think that may make stuff like mypy and pylance freak out

shrewd osprey
sonic silo
#

y2015d04

woven oriole
deep ferry
# shrewd osprey

. .venv/bin/activate && pip install cryptography && deactivate

woven oriole
#

crypto everywhere

sonic silo
woven oriole
#

doge to the earth

#

😔

sonic silo
#

but yeah

sonic silo
#

2015''s puzzles really do feel different to the latter years tbh

deep ferry
deep ferry
shrewd osprey
deep ferry
#

i dont use windows this is weird

signal grotto
sleek cave
#

is a matrix search O(n^2) only? how can you make it more efficient?

#

perhaps sorting the matrix and binary searching (how would that even work lmao)?

deep ferry
#

although my code took 9 seconds