#AdVENt of Code

1 messages · Page 14 of 1

real hinge
#

rustc so bad

tranquil vapor
#

yeah I don't do that

real hinge
#

I also made that function in yesterdays problem

solemn python
#

Easier to conceptualize for me

real hinge
#

stealing it was easy

tranquil vapor
#

i just have 4 separate functions that walk in the different directions

real hinge
#

thats too painful

tranquil vapor
#

on the same array

tranquil vapor
#

i just copy pasted the same func and changed the ranges and +1 to -1

#

was super quick to do

#

and way easier than actually rotating it

solemn python
#

I tried that but I hate 2d vecs

steady fog
#

oh

#

I'm just transposing the array

solemn python
#

And it wasn't working
So I just started over and rotated
A lot easier to read too

tranquil vapor
real hinge
#

but for right left

#

actualy thats easy too

#

idk whatever

tranquil vapor
real hinge
#

guh I dont have much time

#

do I try to implement

steady fog
#

yes

tranquil vapor
#

JavaScript promise rejection: [object Object]. Open browser console to see more details.

#

guh i hate seeing 40yos online cause it reminds me that one day I will also be that old @steady fog

real hinge
#

I decided to not

tranquil vapor
#

do you relate

real hinge
#

ven is already too old

steady fog
#

you must accept it ven

tranquil vapor
#

i will still use anime pfp with 40

steady fog
#

insane

solemn python
#

yop

real hinge
#

ven will be obese in 2053

steady fog
#

yop

#

ven will smoke cigarettes

real hinge
#

OH MY GOD DIE

#

its downloading 9gb of index again

#

WHY

solemn python
#

Is it not using sparse index

real hinge
#

whats that

tranquil vapor
#

UPGRADEE YOUR CAR GOER

steady fog
#

mantika storage will be consumed by cargo

solemn python
#

I'd send a page but ven is annoying and hates rust links

#

Look it up

tranquil vapor
#

@steady fog how do u call a spaniard who has no car

steady fog
#

Volkswagen

tranquil vapor
#

nop

steady fog
#

mantikamobile

real hinge
#

oracle so slow

#

its running 2 times faster in my pc

tranquil vapor
#

run my solution

#

why does ur oracle have windows husk

real hinge
#

is there time command for windows

real hinge
#

I ran on my own pc

tranquil vapor
steady fog
#

manti insane

solemn python
#

mantika will install Linux @real hinge @real hinge

tranquil vapor
#

YOP

solemn python
#

join us

real hinge
#

MY WINDOWS PC

steady fog
real hinge
#

MYL APTOP

real hinge
#

I was using linux from my sd card but it kept breaking

#

dont have much space in nvme

solemn python
real hinge
#

nop

#

what is time command from

#

is it not from gnu utils

steady fog
#

mantika uses 1980 laptop

real hinge
#

but doesnt have time command

#

wait I can run exe files from wsl

hazy sinew
#

thats slow

real hinge
#

fast imo

hazy sinew
#

71ms in kotlin

real hinge
#

considering I recreate array on each rotation

hazy sinew
#

and im not mathing everything im running the last few loops too

hazy sinew
real hinge
#

then how

solemn python
real hinge
#

there is no way jvm app is faster than native code

solemn python
hazy sinew
real hinge
#

guhhh @steady fog stop doing that husk

#

I dont want random pings

steady fog
#

you do

tranquil vapor
#

@real hinge i will add to the #rules that people can dm u for vencord support

real hinge
#

I will close my dms

steady fog
#

mantika loves support

real hinge
#

@tranquil vapor I heard someone saying they like rust in university

#

decided to stay away from him

#

actually rust isnt bad

#

but rust lovers are usually insane

#

(tyman not included)

steady fog
#

what about rusher

real hinge
#

yes

steady fog
#

@real hinge you should be president

real hinge
#

soon

tranquil vapor
#

he will understand

steady fog
#

@real hinge guh I have neuroscience exam in an hour you will do for me

real hinge
#

dont you study computer science

steady fog
#

yes

#

but I need other classes

#

to get all my credits

native pewter
#

so shrimple

native pewter
#

(i will draw penis on every question)

tranquil vapor
#

wait I can optimise my advent of code solution better

#

i clone array each time before putting it in hash but instead of clone i could just use hash manually

#

as in i don't need to clone at all

#

im not home rn but will test later

#

inb4 0ms runtime

#

me randomly getting this idea while waiting for my food

solemn python
real hinge
solemn python
#

depends

hazy sinew
#

did any of yall use .sortedDescending on each row split by # and then just join the row back on #

solemn python
#

How are we measuring sanity

#

Love

tranquil vapor
#

ig cloning array is fast

real hinge
#

I wonder if you can calculate hash somehow faster

#

maybe instead of reading entire array just use some lines

#

it should be unique probably

tranquil vapor
#

should be really fast

#

actually maybe llvm detected what im doing and changed it to a single memcpy

steady fog
#

@tranquil vapor you

#

should i do imgui or gtk4

#

for potential DE

native pewter
#

nice my dumbass tilted to the west instead of north

steady fog
#

how

native pewter
#

idk i didnt read

#

also its not bruteforceable is it

#

||or we doing loop detection?||

sullen fiber
#

||do||

native pewter
#

awesome!

sullen fiber
#

I haven't coded it yet

#

Maybe TMR morning

#

So I can commit them

tranquil vapor
steady fog
#

hi ven

tranquil vapor
#

zeet

steady fog
#

hello!!

native pewter
#

good enough

bronze sage
#

hewo

tranquil vapor
#

what language

native pewter
#

cr

#

nerd

bronze sage
#

clash royale

tranquil vapor
#

based

steady fog
#

clash royale based

native pewter
#

ive only been using crystal for the last few 😭

tranquil vapor
#

hi japanese person

tranquil vapor
#

crystal

steady fog
#

crysta

tranquil vapor
#

clash royale is so dogshit

#

worst game in the world

steady fog
#

you play every day

#

my day 14 p1 solution is so close

bronze sage
tranquil vapor
#

hi weeaboo then

steady fog
#

kill

#

i get 4 short of the actual solution

#

132

steady fog
#

i need 136

#

i dont understand how you count the rocks

tranquil vapor
steady fog
#

its so badly explained

tranquil vapor
#

decent game ruined by greedy company being greedy episode 28938292929

native pewter
steady fog
#

i have an emote

native pewter
#

(i dont play ranked)

tranquil vapor
#

it's a good emote but u don't get to emote if you only won cause you're p2w

steady fog
#

ven have you tried elixir youd probably likei t

tranquil vapor
#

genuinely my deck is level 13/14 and I consistently played against people with max level 15 deck cause im very good at the game so im high

#

it's like the game punishes you for being good

#

cause you gotta suffer cbt every game if you're good

#

<@&1015072428843601962>i.xen do you do advent of code

#

GUH DISCORD

native pewter
tranquil vapor
bronze sage
tranquil vapor
#

send ur repo

bronze sage
#

lol

#

ok

tranquil vapor
bronze sage
native pewter
#

nerdddddd

steady fog
#

advent of guh

native pewter
#

I'm focusing on competitive programming. s
damn real nerdd

bronze sage
#

smhymyhead

native pewter
#

so?

bronze sage
#

actually im focusing on nothing

native pewter
#

so true,

sullen fiber
#

@native pewter did u do today

tranquil vapor
#

she did

solemn python
#

@steady fog@steady fog@steady fog

steady fog
#

@solemn python its time

tranquil vapor
#

NO

#

wait what that seems so easy

#

well part 1 anyway

#

i will sleep first tho

solemn python
#

its just funny its called the "HASH" algorithm

real hinge
#

this looks terrible

solemn python
#

why

real hinge
#

I hate hashing algorithms

#

anyway lets try

solemn python
#

this is barely a hash algo

#

its just like 2 steps of math per char

real hinge
#

asii code * 17 % 256

#

is that it lmao

real hinge
steady fog
#

guh

#

i need to rename my files

#

stupid nim doesnt like the file name

#

its so dum

#

mantika moment

real hinge
#

okay don part1

#

might be my fastest part1

solemn python
#

Holiday ASCII String Helper Manual Arrangement Procedure, or HASHMAP for short
guhh

teal mountain
#

me reading part 2:

#

i think it legitimately took me about 8 minutes to start writing code, idk if it's the fact that i woke up late but this was impossible to understand

solemn python
#

im still reading it

steady fog
#

ive been

#

trying to use regex

#

to change all my filenames

#

this is hell

#

i havent even started the aoc

real hinge
#

I dont get how we know which box to put

sullen fiber
#

Wth is today

#

Too drunk for this wtf..

steady fog
#

nim syntax is so ulgy

#

this is like python but worse

#

its so slow compiling

sullen fiber
#

Zt

#

Zt

steady fog
#

Vap

#

Vap

sullen fiber
#

Do today in Uiua for me

#

Plzzszz

steady fog
#

never

sullen fiber
#

Oldkslslsss

#

Plssss

steady fog
#

@real hinge will do

sullen fiber
#

Manti

#

Manti

real hinge
#

never

tranquil vapor
#

how insane is part 2@real hinge

real hinge
#

little bit

steady fog
#

The arrays in Nim are like classic C arrays, their size is specified at compile-time

#

NO

real hinge
#

it doesnt seem terrible but I dont one thing

steady fog
#

NO.

real hinge
#

WHICH BOX DO I PUT THE LENS

#

guh I will parse

#

will think about it later

steady fog
#

you will go bald

tranquil vapor
#

GUHH NIM IS INDENT BASED

#

that's so bad

hazy sinew
steady fog
#

its bad

solar tide
delicate crane
#

p2 passes test but breaks on input

steady fog
#

mantika moment

delicate crane
#

please give hint to edge case

steady fog
#

whats that

proper totem
steady fog
#

oh

teal mountain
real hinge
delicate crane
#

misinfo

real hinge
#

oh wait

teal mountain
#

took me legitimately 10 mins to understand why they were ||putting stuff in box 0 when the hash of the first one was 30||

real hinge
#

I tried the number

teal mountain
#

no the first part

#

before the =/-

real hinge
#

oh lmao

#

I tried to get hash of the number

#

then what even is the point of number trolldayruined

steady fog
#

@real hinge im so powerful

teal mountain
#

it's the ||focal length of the lens||

#

like it's the value in the entries you see

tranquil vapor
#

i wish they added better ranking

#

wait i have a good idea for ranking

steady fog
#

no

tranquil vapor
#

we will rank by runtime

#

fastest solution wins

tranquil vapor
real hinge
proper totem
#

will you have a consistent run platform or just what people report

real hinge
#

also it would put more pressure on site

#

lot more

tranquil vapor
#

no i mean just for us

delicate crane
#

has anyone found an edgecase between example and input for p2

#

Im lost

real hinge
#

create a docker that will run our code and rank by it

tranquil vapor
#

yes

#

soon

hazy sinew
delicate crane
#
const [, label, operation, num] = /(\w+)(=|-)(\d*)/.exec(str)!
const box = hash(label)

if (operation === '=')
  boxes[box][label] = Number(num)
else
  delete boxes[box][label]
hazy sinew
#

send full code ig

delicate crane
#

||```ts
function hash(str: string): number {
let out = 0
for (const char of str) {
const charCode = char.charCodeAt(0)
out += charCode
out *= 17
out %= 256
}
return out
}

export function partOne(input: string): number {
return _.sum(input.split(',').map(hash))
}

const boxes: Record<string, number>[] = Array.from({ length: 256 }, () => ({}))

function a(str: string) {
const [, label, operation, num] = /(\w+)(=|-)(\d*)/.exec(str)!
const box = hash(label)

if (operation === '=')
boxes[box][label] = Number(num)
else
delete boxes[box][label]
}

function focusingPower(box: Record<string, number>, boxIndex): number {
return Object.values(box).map((v, i) => (boxIndex + 1) * v * (i + 1))
}

export function partTwo(input: string): number {
// ! not 212832
input.split(',').map(a)
// console.log(boxes, .isEmpty)
// console.log(
.reject(boxes, _.isEmpty).map(box => Object.values(box)))
return .sum(boxes.map(focusingPower).map(.sum))
}

hazy sinew
#

idk that looks exactly like my code

#

whats ur output

delicate crane
#

I figured it out

#

I got myself timed out by calling myself the R word

hazy sinew
delicate crane
#

I put my ||boxes in a global variable

const boxes: Record<string, number>[] = Array.from({ length: 256 }, () => ({}))

||
and I didn't reset the value between the test and the real

solemn python
#

today is a nice break from whatever the hell the past few days were

#

its not super hard, just a fun little task to do

#

I like it

delicate crane
hazy sinew
solemn python
#

though of course we can't really compare running on diff computers

tranquil vapor
#

shrimply run on vps

solemn python
#

wonder how fast this runs on my rpi

tranquil vapor
#

people submit their code and it runs it

solemn python
#

love

solar tide
tranquil vapor
solemn python
#

I'd make that

#

honestly

tranquil vapor
#

some time ago mantika ran smth insane on my vps and it used three billion percent cpu and exploded everything

solemn python
#

run it all in docker so someone doesn't do a funny

tranquil vapor
#

i forgot what

solemn python
#

mantika is rich now

solar tide
#

I'm ratelimited by 5mins now so fuck lol

solemn python
#

skull issue

#

I only had one issue and its because I didn't read the prompt

delicate crane
solemn python
#

I was multiplying focal length by lens index and forgor the box index

#

and I could easily tell it was wrong b/c it failed the example

solar tide
#

no I was thinking earlier if there's another way

delicate crane
#

I got tripped up by assuming the labels would always be 2 characters

hazy sinew
#

oh yeah why is the input so long

#

maybe its actually a crypto miner

hazy sinew
#

i just took the substing before = -

solar tide
solemn python
delicate crane
solemn python
#

he is making bank off of all these solutions

delicate crane
#

I switched to regex when I realized they varied

solemn python
#

ever heard of .split

#

its pretty cool

delicate crane
#

no good character to split on

solemn python
#

I check it, then split

#

no regex involved

#

if the last char of the string is a '-', then its a minus operation

#

otherwise, split by =

delicate crane
#

yall avoid regex like the plauge when its stupid simple and fast to write

solemn python
#

(no)

warped dust
#

makes aoc not fun

warped dust
#

or ur regex sucks

solemn python
#

I used a bit of regex before but that was a more complex string

delicate crane
solemn python
#

actually
I can easily improve my code now that I think about it

#

and only iterate over the str once

delicate crane
#

I have most of regex that I use by heart so its 0 mental effort

warped dust
#

regex too easy to write

steady fog
#

@warped dust

#

regex is torture

delicate crane
real hinge
#

now I can go lazy for another 23 hours

warped dust
#

the fun comes from nowhere i lied

#

i hate aoc

delicate crane
#

then use regex so you can do it faster?

warped dust
#

i havent solved day 4 pt2

real hinge
#

if you need to do thausands of checks it becomes problem

#

(not a case in this problem)

delicate crane
#

I haven't done d12p2

warped dust
#

in interpreted languages like js actually no

#

regex can be faster

real hinge
#

but bleh I am trying to avoid regex as much as I can

delicate crane
real hinge
#

it feels like cheating

#

also it really caused major slowdowns in old problems so

solemn python
real hinge
#

I only use regex if its really hard to parse

delicate crane
solemn python
#

rust

real hinge
delicate crane
warped dust
#

just use a clock

#

any cheap wristband watch will suffice

real hinge
solemn python
# real hinge how do you bench btw

I made my own benchmarking thing inside my project b/c my program spends time fetching inputs and parsing cli stuff so hyperfine wouldn't be accurate

real hinge
#

oh

steady fog
solemn python
#

whoops, channel flood

#

hey at least its not a spoiler

real hinge
#

that looks oooverly complicated

#

but love

solemn python
#

yeah I was bored in-between days

#

and its also a really bad benchmarker

warped dust
#

max minus avg is not standard deviation

solemn python
#

if the solution is fast enough, the +- is higher than the avg

warped dust
#

yeah cuz thats not How It Works

#

google standard deviation

real hinge
#

cargo has bench command from what I seen

#

if you fetched inputs in a script it would probably be easier

real hinge
warped dust
#

cargo bench not stable

real hinge
#

it throws errors saying its unsafe Kekw

warped dust
#

its not

#

ur dum

solemn python
#

I know how stats works

#

thats just what I named the variable

#

its max(max_time-avg, avg-min_time)

#

I should make it std deviation though, good point

#

but as I said, "its also a really bad benchmarker"
i didn't remake the entirety of hyperfine

solemn python
#

also it lets me overcomplicate things which just adds to the fun of AoC for me

delicate crane
#

@solemn python how fast is your day 10 p2

real hinge
#

not everytime you run

delicate crane
solemn python
#

what method did you use

solemn python
delicate crane
#

28 seconds

tranquil vapor
solemn python
#

you can do that????

delicate crane
hazy sinew
tranquil vapor
solemn python
#

thats the number it gives after the +-

hazy sinew
#

the std deviation of [1, 1, 1, 1, 1, 1, 1, 1, 1, 100] isnt 89 is it

tranquil vapor
#

horror did u brute force day 10

solemn python
#

so probably idk, ill make it use the std deviation formula later

delicate crane
solemn python
#

I saw the odd pipes away trick but I didn't want to use it because I never would have thought of it

#

my solution is flood fill

solar tide
solemn python
#
  1. Store all of the pipes in the loop
  2. Set every other tile to .
  3. Expand the grid by 2, keeping all pipes in the loop connected
  4. Flood fill starting from (0,0), keeping track of which empty tiles were there before and which were added after expansion
  5. Subtract the amount of original empty tiles in the beginning with the amount flood filled
  6. Thats your answer
tranquil vapor
solemn python
#

^ my method

tranquil vapor
#

or is this another scripting language sucking at performance moment

solemn python
delicate crane
tranquil vapor
delicate crane
tranquil vapor
#

learn one it's worth it :3

delicate crane
#

I will learn rust one day

#

later

tranquil vapor
#

bad idea

#

learn go or crystal or even C#

#

trust

delicate crane
#

wait crystal is compiled?

tranquil vapor
#

it's much easier

#

yes

delicate crane
#

how close is crystal to ruby

#

I have heard they are close

tranquil vapor
#

almost identical

delicate crane
#

ok so I should just do AOC 2024 in crystal

tranquil vapor
#

u can rename .rb to .cr and change a few lines and it runs

tranquil vapor
#

crystal has comparable performance to rust

delicate crane
#

I dont even write much js in my day job anymore
mainly ruby

solemn python
# tranquil vapor DO NOW

basically I actually used some logic to connect the pipes correctly when the flood fill doesn't even care what type the pipe is, as long as it isn't a . it will see it as a wall

tranquil vapor
solemn python
#

it is nice to visualize if I want to do that in the future tho I guess

#

wait nvm im dumb

#

I can't do that

#

ignore me

delicate crane
#

compiled language without required typing aintnoway

delicate crane
#

chomp

tranquil vapor
#

chomp

solemn python
#

oh

#

shoulda guessed

tranquil vapor
#

normal readlines includes \n at the end of each line

#

cause ruby insane

solemn python
#

huh

delicate crane
#

ruby NOT insane

tranquil vapor
#

/run ```rb
print File.readlines "file0.code"
puts
print File.readlines "file0.code", :chomp => true

split heartBOT
#

Here is your rb(3.0.1) output @tranquil vapor

["print File.readlines \"file0.code\"\n", "puts\n", "print File.readlines \"file0.code\", :chomp => true\n"]
["print File.readlines \"file0.code\"", "puts", "print File.readlines \"file0.code\", :chomp => true"]```
tranquil vapor
#

just doesn't include the newlines

#

crystal has chomp enabled by default (good imo)

#

who tf wants newlines at the end of each line when they use .readlines

real hinge
steady fog
#

@tranquil vapor is Ruby bad

#

you keep using it

tranquil vapor
#

ruby good

steady fog
#

but

#

Crystal

delicate crane
#

is there like
Crystal on Rails?

warped dust
#

ror fans when i rail thei

steady fog
#

@warped dust @warped dust @warped dust @warped dust

solemn python
tranquil vapor
solemn python
#

parentheses-less programming looks so funny to me

tranquil vapor
delicate crane
tranquil vapor
#

/run ```rb
puts "i am crazy".upcase.split.reverse.join

split heartBOT
#

Here is your rb(3.0.1) output @tranquil vapor

CRAZYAMI
solemn python
tranquil vapor
#

yus

steady fog
#

ven loves groovy

delicate crane
tranquil vapor
#

crystal ecosystem is kinda small

#

sadly

#

the language isn't very popular for some reason foreign to me

#

so many people love ruby and crystal takes ruby and makes it super fast

#

so crystal was destined to blow up, yet didn't?

solemn python
#

it didn't blow up, it explod-ed

delicate crane
#

I doubt amber has a hotwire/turbo equivalent, so I don't think it would be viable for me to switch for any of my rails projects

tranquil vapor
#

yeah likely not

#

it's also not as battle tested

#

crystal is awesome but idk if using it in production is the best idea

#

id personally just use it for hobby projects and it seems amazing for clis (even prod clis)

delicate crane
#

Big companys rely on and contribute to the RoR ecosystem, so it will always be good

#

that being said, even shopify cant make a functional linter for it that doesn't crash every 10 minutes in a production scale project

#

and there is no way to lint .html.erb for indentation and ruby style at the same time

#

many complaints

solemn python
#

Average timing: 374.616µs ± 164.242µs
there
standard deviation now
is everyone happy

delicate crane
tranquil vapor
#

the ruby lsp is pretty shit

#

even though ruby is popular

delicate crane
#

its way better than it was before shopify came along

tranquil vapor
#

crystal lsp is even worse than ruby but that's understandable cause it's literally just made by people in their freetime

#

but ruby?? huhh??

#

anyyywayy yeah definitely give crystal a shot!! it's basically just ruby (with small changes like removal of for statement, required explicit typing for arrays, map, set, etc declarations, some minor naming differences, and ofc a different ecosystem) but blazingly fast

rustic orchid
#

betterruby

tranquil vapor
#

crystal is duck typed so you hardly ever actually need to specify types which is kinda insane

solemn python
tranquil vapor
#

you only need to type containers / data structures which is understandable cause of memory management reasons

steady fog
#

what's duck typed

tranquil vapor
steady fog
#

okay

delicate crane
solemn python
tranquil vapor
#

but it depends what u mean by hot reloading

delicate crane
#

type, look at terminal, see output and test result

tranquil vapor
#

oh u can easily have that

#
require "option_parser"

OptionParser.parse do |parser|
  parser.banner = "Welcome to The Beatles App!"

  parser.on "-v", "--version", "Show version" do
    puts "version 1.0"
    exit
  end
  parser.on "-h", "--help", "Show help" do
    puts parser
    exit
  end
end
#

this looks pretty cool

solemn python
#

I mean cargo watch exists

tranquil vapor
#

part of stdlib

solemn python
#

Which isn't hot reloading but any watcher thing will work

rustic orchid
#

The Beatles App

warped dust
#

vee did u see the crystal web framework

#

u will use

tranquil vapor
#

soooon

#

i still want to write activitypub shit in crystal

solemn python
#

I would use

steady fog
#

@tranquil vapor should DE have precompiled core, or require core + whatever the user adds

solemn python
#

I wanted to do some AP stuff but then realized how complex it all is

#

Maybe at some point

#

AoC is taking up my motivation for the month

delicate crane
#

why does sharex record audio of twitch, rude

tranquil vapor
#

most likely

steady fog
#

answer

proper totem
#

puts and gets

solemn python
#

Legend of Zelda moment

#

I think that was BoTW

delicate crane
#

totk

proper totem
#

oo

#

crystal neat

steady fog
#

yop

tranquil vapor
delicate crane
#

It takes me like 3 days to make my repo so I will wait to do crystal either

  1. this February and I will do like 2015
  2. next year
delicate crane
steady fog
solemn python
#

I made the most boring repo ever for the first few days and have slowly been improving it between days
At some point before the end I'll probably have hot-reloading or at the very least a nice file watching setup
I found a hot-reloading crate a bit ago

steady fog
solemn python
#

Hint: Click on anything you don't understand.
I clicked on De Bruijn indexed lambda calculus and it did nothing

delicate crane
rain bloom
#

crystal is like half dead
really unfortunate

proper totem
#

vencord will revive crystal

solar tide
#

anyway rewrote my git history to scrub off input.txts

solar tide
native pewter
real hinge
#

@tranquil vapor aoc

#

today is easy

#

I bet tomorrow will be terrible

#

16th day is always bad

native pewter
#

ur bad

real hinge
#

I completed all 15 days

native pewter
hazy sinew
#

so who knoes

#

and honestly id love a dfs

solemn python
#

love

native pewter
#

nerd!

real hinge
#

4 hours

#

that sounds insane

#

2018 day 15 too

#

and this years problems were comparably way easier

#

which is scary

tranquil vapor
#

i think it might just be that advent of code was not very popular back then?

solemn python
#

@real hinge ghost ping smh

real hinge
#

2.5 hours dread

solemn python
#

Yop

#

📸

native pewter
#

caught in 420p

real hinge
#

which one is ghost

real hinge
real hinge
solemn python
#

Nvm

real hinge
#

discorc moment

solemn python
#

Looks like 8881 people did p2 that day

#

2146 did p1 only

#

^ which is most definitely an outlier

real hinge
#

ahahah

#

I wasnt really expect this to be a thing

#

guh wth is this

#

is discord going to make regional pricing worse like steam

#

@vapid ice

vapid ice
#

mantika

real hinge
#

dzirwa

vapid ice
#

latam spanish

#

xd

real hinge
#

steam recently switched to LATAM USD which was their own currency

vapid ice
#

horror

real hinge
#

so I thought we were going down on discord too

sullen fiber
#

Oh god part 2

#

||imma have to make hashmaps in Uiua kill me||

hazy sinew
#

||make a list of lists||

sullen fiber
#

||yea it's just that I'll have to do the replace logic||

#

Maybe it's easy let me see

real hinge
#

I was gonna do list of lists

#

but unless its static array it would break all the indexes

#

so i did hashmap

#

also I think hashmap isnt slower if you use integers

#

since it probably doesnt hash it

sullen fiber
#

Actually

#

||I could just index all the labels first and then treat box slots as a matrix||

real hinge
#

or you could NOT iuia

sullen fiber
#

nah

#

wait fuck iforgot i have to keep track of slots

#

day ruined

#

wait

#

||simply will keep another matrix of update times||

#

nvm list of lists easier

sullen fiber
#

yea actually i lied list of lists isnt easier

sullen fiber
#

for the example

#

||its not that hard to turn the top matrix into slot numbers: ⊙≡(⍜▽(+1⍏) ≠0.) ⊃(∘|×≠0)||

sullen fiber
#

to do wat

hazy sinew
#

Ө=Жلل إِلَٰهَ إِلَّا ٱللَّٰهُ

sullen fiber
#

fake

#

cyrillic abjad when

hazy sinew
#

cyrillic what

sullen fiber
#

abjad

#

writing systems where vowels are implied

#

like arabic

hazy sinew
#

that wont work

sullen fiber
#

i mean it probably could

sullen fiber
hazy sinew
#

@sullen fiber

#

im gonna learn noulith

solemn python
#

Probably wouldn't be faster in any way, bit it would be a cool way to do it

sullen fiber
#

Time to look into that

sullen fiber
#

Wait this is gas

hazy sinew
tranquil vapor
#

OKAY ADVENTUS OF CODUS TIME @real hinge

sullen fiber
#

I'm just not goated

native pewter
#

wwyd jf i uiuad u

tranquil vapor
#

VAP

#

IF YOU SAY "TODAY UIUIABLE" ONE MORE FUCKING TIME

native pewter
tranquil vapor
#

I WILL FUCKING COME TO YOUR HOUSE

native pewter
#

today uiuable

tranquil vapor
#

AND MAKE YOU SHUT UP ABOUT UIUA FOREEEEVER

sullen fiber
#

It's too late

native pewter
sullen fiber
#

I even got people in Uiua discord saying Uiuable

native pewter
#

we can make out to crystal code

sullen fiber
#

U can't stop it now

#

Oh this lang is super indev

#

But not active

#

Rip

#

Could have been so good

native pewter
tranquil vapor
#

i just uiud your mom @sullen fiber

sullen fiber
#

Fire

#

Thanks twin 🤞

real hinge
#

@tranquil vapor do aoc idiot

#

its so easy

tranquil vapor
#

SOOOOON

real hinge
#

ven cant figure out how to make the hash function

tranquil vapor
#

guh i havent looked yet

real hinge
tranquil vapor
#

HashMap::with_mantika()

real hinge
#

actually it should work if there is dupes

#

I still havent figured out how to debug rust

#

I just use prints blobcatcozy

#

I think I needed c++ debugger extension or smthn but it didnt work

tranquil vapor
#

STOP USIN RUST

solar tide
real hinge
#

tbh I am not gonna lie

#

rust really has lots of cool stuff while being fast

tranquil vapor
#

crystal way cooler blobcatcozy

real hinge
#

but getting used to stupid borrow stuff was horror

solar tide
#

gleam is also fun

real hinge
#

rust literally has any function you would need

solar tide
#

did a gleam run today

tranquil vapor
#

rust fans when i borrow their girlfriend as mutable

real hinge
#

and unwrap

tranquil vapor
#

TRUE

warped dust
#

cant mutuably borrow more than once at a time

steady fog
#

I tried gleam but i can't do it on a single file

solar tide
#

rust fans when their girlfriends are not Ok

warped dust
#

dumbas

solar tide
#

skill issue

real hinge
#

anyway time to eep

#

need to wake up in 7 hours for aoc

steady fog
#

gn

real hinge
#

night night

tranquil vapor
#

YOU ARE ADDICTED

#

guhh advent of code tryhards will die

real hinge
#

I just want to see how much I can go until I fed up

#

I always wake up in 7:20-8 AM

#

Aoc just fits exactly into the time I wake up

tranquil vapor
#

imagine waking up and immediately thinking CODEEE CODEEE

#

when i wake up i am sooo lazy

hazy sinew
real hinge
real hinge
#

Breakfast first

#

Yop

#

Anyway night

hazy sinew
native pewter
#

gn manter

tranquil vapor
#

@real hinge wake up and assist me with advent of code

#

i need ur help

#

so hard today

tranquil vapor
#

OH MY GOD

#

PART 2 IS READING COMPREHENSION

#

i feel like im in math class again

#

oh god theyre just describing a hashmap

tranquil vapor
#

part 2 was easy

#

I WASTED LIKE 10 MINUTES CAUSE OF A STUPID MISTAKE

tranquil vapor
native pewter
#

read the docs first next time blobcatcozy

tranquil vapor
#

today was so easy i solved it in 33 lines of code

#

anyway part 2 is literally exactly how hashmaps work

#

they just use an array and calculate index in the array with a hash function

then to set / access keys it calculates the index, then checks each item at that index to see if it's the correct key

#

so literally the same concept as today's part 2

#

@sullen fiber PAAART TWOOO

#

SOOO UIUABLE

steady fog
#

is the boxes/crates just an array

tranquil vapor
#

do u want me to sum up the text

steady fog
#

yes

tranquil vapor
# tranquil vapor do u want me to sum up the text

not really a spoiler, just part 2 exercise summarised:
||
you have an array of 256 boxes. each box is also an array
the steps are in the form LABEL- or LABEL=LOAD_FACTOR
you calculate the box index (boxes[i]) by running the hash func on the label, so box = boxes[hash(label)]
if the step has =load_factor you need to store the label and the load_factor in the corresponding box. if the same label already is in that box, replace the old one in place (same index)
if the step ends with - you just remove the corresponding box with that label
||

#

this part confused me so much but its irrelevant info just ignore it

steady fog
#

boxe

sullen fiber
#

I just have a bug and I was only at the library for a little bit

tranquil vapor
#

@steady fog did u solve

steady fog
#

havent started

solemn python
sullen fiber
native pewter
#

uiuable

solemn python
#

(it isnt working)

#

(and im not making a Label struct just to implement Eq to make this work)

tranquil vapor
#

why would u even make a hash

#

this is really trivial with || Array<Array<Tuple<String, Int32>>>[256] ||

solemn python
#

GUHHH

#

too many brackets

solemn python
warped dust
#

mmm id like an Array<T>[256]

solemn python
#

lol not using a hashmap and instead using a const-sized array shaved off 100µs

#

crazy

tranquil vapor
#

i just added the [] to indicate the fixed length (which makes it easier)

solemn python
#

@tranquil vapor loves

#

rust so funny sometimes

#

if you do [Vec::new(); 256] it yells at you b/c of cloning or something

warped dust
#

bc it copies

#

not clone

solemn python
#

if I use nightly features I can do this trolley

warped dust
#

normal

solemn python
#

I can also move the generics to make it even more funny

#

there are so many cool unstable features they should just stabilize
can't be that hard right clueless

steady fog
#

tyminky

warped dust
#

if let guards are still unstable

#

the rfc is six years old

solemn python
#

you mean if let Some(thing) = thing { /* do stuff */ }?

warped dust
#

but in match guards

solemn python
#

today I learned match guards exist

warped dust
#

how

#

so useful

solemn python
#

idk, never seen it I guess

#

probably will use that a bunch tho

#

but anyways I was talking about try blocks and if let chaining mostly, those are the two that keep popping up for me

real hinge
#

gosh I am very eepy

#

how bad is today

steady fog
#

fuck it. im doing fortran

real hinge
#

oh it doesnt seem bad

tranquil vapor
#

it seems easy

steady fog
#

@tranquil vapor make pip not suck when

tranquil vapor
#

never

#

don't use python

#

so bad

#

use crystal

tranquil vapor
#

probably part 2 will be some insane anti brute force again

real hinge
#

part2 is probably husk

tranquil vapor
#

part 2 will be send 3 billion lights at once

#

and only energise fields where lights cross at 12:37 o clock

#

i should fix my schedule again and wake up at 6am like you

real hinge
#

yop

#

do this

#

also I wake up ay 7:30 AM

#

not 6

tranquil vapor
#

turkey moment

#

it's 6 here

steady fog
#

venny

#

fortran compiles so fast

#

wtf

#

@tranquil vapor

#

this isnt too bad

#

its so much easier than cobol

solemn python
#

hm do I do loops (good) or recursion (evil)

steady fog
#

loop

solemn python
#

ok

#

this is also a text block but its a very comprehendable one

#

also this is kinda just pipes v2

#

lol

#

ok now do I use structs (good) or tuples (evil)

steady fog
#

struct

solemn python
#

👍

real hinge
#

hmm my code is running forever

teal mountain
#

today was fun

teal mountain
teal mountain
#

if you have bad recursion you will get stack overflow

#

if you have bad loop it will just run forever and you'll wonder if you need to optimize or if you're missing an exit condition

#

(/hj)

tranquil vapor
#

my ass is not making a struct

steady fog
tranquil vapor
#

WHAT IS THAT

real hinge
#

I endlessly create lasers in position X:1 Y:!

steady fog
tranquil vapor
steady fog
#

yop

real hinge
#

I created a glorious system

solemn python
#

@warped dust are u proud of my match guards

teal mountain
#

i am so glad i did direction with ||vectors||

solemn python
#

hm

#

thats actually kinda smart

#

but meh ||enums|| are funnier

teal mountain
#

||```ts
if (point.v === '/') {
[dirX, dirY] = [dirY * -1, dirX * -1];
}

if (point.v === '\') {
[dirX, dirY] = [dirY, dirX];
}


the ONLY thing ||high school linear algebra|| has been good for
real hinge
#

my laser have found a way to duplicate themselfs

#

laser count goes forever

solar tide
#

advent of parsing

solemn python
#

I ran my solution and KDE froze

solar tide
#

hm what language do I do today, crystal or rust

solemn python
#

Help

solar tide
#

LOL

sullen fiber
#

Also this is kinda what I used

solar tide
#

ok crystalist time

steady fog
#

oops

#

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

#

mantika moment

sullen fiber
#

I'm on the bus back home @void

#

@native pewter

#

I will aoc in 8 hours

solar tide
#

stay safe vaporizer

steady fog
#

minky is so loud

solemn python
real hinge
#

I shouldnt be allowed to code in rust

#

I wrote worlds shittiest code

#

(it doesnt even work)

solemn python
#

this is a normal amount of items to have in a vec right

real hinge
#

totally

steady fog
#

???

#

this doesnt make sense

#

fortran is inserting a newline between each print

solemn python
#

ok I stopped my 13 billion vec length issue but now my answer is wrong

#

love

solar tide
#

why wouldn't it

steady fog
#

oh there it goes

#

but its kinda broken

#

it doesnt like the /

#

yay ifixed

#
program aoc
   Use, intrinsic :: iso_fortran_env, Only : iostat_end
   implicit none
   integer :: io, iostat
   character(256) :: line

   open(newunit=io, file="./input/day-16.txt", status="old", action="read")

   do while(.true.)
      read(io, "(A)", iostat=iostat) line

      select case(iostat)
       case(0)
         print "(A)", trim(line)
       case(iostat_end)
         exit
       case default
         write(*, *) 'Error in reading file'
         stop
      end select
   end do

   close(io)
end program aoc
``` @real hinge boo
solemn python
#

5 extra places it shouldn't be

#

what

#

I printed the output grid and its the same as the example output grid

real hinge
#

okay lets think simple

#

its a simple task

#

it should've worked

#

then why does it not work

solemn python
#

p1 done

#

guh

#

was itertools being dum

real hinge
#

I think I should done recursion

#

I handled it very stupitly

solemn python
#

lol p2 is a very bad "now optimize it"

#

it took my shitty rust code 5 seconds

real hinge
#

on part2?

solemn python
#

p2

#

ill do it right eventually

#

like I did with whatever the pipe day was

solemn python
#

my thoughts on today

#

the 3 brands of AoC part 2s:

  1. An actual unique and interesting spin on the first part (extremely rare)
  2. "Do the last thing but more so you have to be smart about it"
  3. "Do the last thing but more so you have to be smart about it" but you don't have to be smart about it with any fastish language
#

rate new benchmark output

real hinge
#

me when map is correct but its giving wrong result 🥹

#

I dedup the visited locations

#

insane

#

GUH FOR DEDUP TO WORK ARRAY HAS TO BE SORTED

#

INSANE

steady fog