#AdVENt of Code

1 messages ยท Page 15 of 1

real hinge
#

great my code runs fine on example and forever on real input

solemn python
#

added median b/c why not

real hinge
#

and I dont even have a way to check if its causing some loop

solemn python
#

I ran into that same issue lmao

#

just .sorted().dedup()

real hinge
#

yeah it causes infinite loop

solemn python
real hinge
#

how th do I even debug this

solemn python
#

and fixed it and had no issue afterwards

#

today's p2 go brrr

real hinge
native pewter
#

uiuable???

sullen fiber
#

Soon

native pewter
#

oh did i wake you up mb

sullen fiber
native pewter
#

aww :c

sullen fiber
#

Ok time to read and see if today is Uiuable

#

Lol part 1 is just ||my pipes code||

#

||when I did pipes I treated them as / and \ so this is actually simpler||

#

||also Uiua has memoization now. Everything is Uiuable...||

sullen fiber
#

Unhusk me immediately

real hinge
#

go uiua yourself

tranquil vapor
#

STOP POSTING ABOUT UIUA! I'M TIRED OF SEEING IT! MY FRIENDS ON TIKTOK SEND ME MEMES, ON DISCORD IT'S FUCKING MEMES! I was in a server, right? and ALL OF THE CHANNELS were just uiua stuff. I-I showed my champion underwear to my girlfriend and t-the logo I flipped it and I said "hey babe, when the underwear is uiuable HAHA DING DING DING DING DING DING DING DI DI DING" I fucking looked at a trashcan and said "THAT'S A BIT UIUABLE" I looked at my penis I think of an astronauts helmet and I go "PENIS? MORE LIKE PENUIUA" AAAAAAAAAAAAAAHGESFG

hazy sinew
#

@teal mountain this u

teal mountain
#

lol i'm surprised i won todays

hazy sinew
#

yea i got screwed by ||spawning on a mirror||

teal mountain
#

wtf

hazy sinew
#

this looks so silly

sullen fiber
#

true

sullen fiber
#

wow i am crazy t ired

#

maybe i sleep firs

native pewter
#

today weewable

solar tide
#

today's puzzle was such a banger

#

I was stuck on it for an hour

real hinge
#

what is the fire on day17

#

fire is uually bad

#

tomorrow we will die

steady fog
solemn python
#

I think

#

We are fixing the islands

real hinge
#

THATS NO GOOD

steady fog
#

@real hinge you are in danger

steady fog
#

@real hinge In file 'd16.f90', around line 16: Error reallocating to 281105609523200 bytes: Cannot allocate memory

native pewter
#

bald about it

sullen fiber
#

ok

#

good morning

#

ok this is fire

real hinge
#

tomorrow will be fire

#

very fire that we will burn to die

sullen fiber
#

oh true

steady fog
#

mantika loves

hazy sinew
#

@sullen fiber is tomorrow weewuhable

sullen fiber
#

i got distracted and wanted to make an animation for part 1's example

sullen fiber
#

sike i did it on my input

#

@hazy sinew rate gif code

warped dust
#

is vencord uiuable

#

&@high lintel "example.gif" &gife 10

sullen fiber
#

yes

#

fawna is uiuable

solemn python
#

But the real question

tranquil vapor
#

ADVENT OF CODE TIME

solemn python
#

Is uiua uiuable

solemn python
#

It's kinda just pipes v2 but still fun

tranquil vapor
#

PIPES V2 SOUNDS HORROR

solemn python
#

Plus part 2 is Not Hard

warped dust
#

uiua-llvm

sullen fiber
#

soon

tranquil vapor
#

should i do recursion or loop

#

also do i need a stop condition or do all beams naturally come to a halt

sullen fiber
#

they can loop

tranquil vapor
#

horror

sullen fiber
#

you love

#

@solemn python how fast does ur part 2 run

#

oh u posted

#

oh nice its not that far from my uiua

#

uiua is blazingly fast?!?!?1

#

@hazy sinew can u help me with my d15p2

tranquil vapor
#

what do u need help w

native pewter
#

today uiuable!???????

tranquil vapor
#

noppp

sullen fiber
tranquil vapor
#

sort?

sullen fiber
#

so i can figure out what mine is doing wrong

#

yea like do the

#

part 2

#

final state

tranquil vapor
#

i can

sullen fiber
#

omg

native pewter
sullen fiber
#

here is my input

native pewter
#

aray based vendicated???

sullen fiber
native pewter
sullen fiber
#

who did this

native pewter
#

insane!

sullen fiber
#

who made shiki work on files

#

its kinda fire

tranquil vapor
#

CRYSTAL LANG BROKEN

#

JSON LIB IS BORKEN

sullen fiber
#

F

#

json horror

#

just do like plaintext

#

printing

tranquil vapor
#

there

tranquil vapor
#

so weird

#

note how that error is coming from crystal source

#

time to edit crystal source

#

lol i fixed crystal

sullen fiber
#

lmaoo

tranquil vapor
#

the issue is that it's using the generic Object.to_json

#

i adapted their Array.to_json for StaticArray and it works

#

time to pr to crystal lang

#

its time

sullen fiber
#

INCOMING PR

#

ok i think i know the issue

#

@tranquil vapor ||when u replace a label with a new value, does it stay in the same slot?||

tranquil vapor
#

yes

sullen fiber
#

THATS IT

#

ok

#

time to fix

steady fog
#

@tranquil vapor you will help me make crystal de

#

make a planner

#

of all the components

#

and I will do

#

seriously I will do

sullen fiber
#

unhinged

tranquil vapor
steady fog
#

I'm so sane @tranquil vapor

steady fog
#

you will make a repo

#

and invite me

native pewter
#

@tranquil vapor uiuable?

steady fog
#

@tranquil vapor vennable?

warped dust
#

@sullen fiber inv replaced by un??

sullen fiber
#

ya

warped dust
#

kill weewuh

sullen fiber
#

unbox you love

warped dust
#

i hate uiua

sullen fiber
warped dust
#

nope

#

0/10

sullen fiber
#

WTF

#

WHY UIUA HATE

warped dust
#

dont care about anything uiua anymore

#

i need to make a new array language

sullen fiber
#

actually do

warped dust
#

UNBOX IS TWO SYMBOLS WHY

sullen fiber
#

i will hop on

#

i want breakpoints in uiua soo badd

daring marlinBOT
# warped dust https://github.com/uiua-lang/uiua/blob/main/site/deploy.ua

**deploy.ua: **

โœ… โ† โคโŠƒโ‹…โˆ˜โ‰0

&cd "site"
โœ…&runi {"git" "checkout" "site" "-f"}
โœ…&runi {"git" "reset" "--hard" "origin/site"}
โœ…&runi {"git" "rebase" "main"}
โœ…&runi {"trunk" "build" "--release"}
โœ…&runi {"git" "add" "--all"}
โœ…&runi {"git" "commit" "--amend" "--no-edit"}
โœ…&runi {"git" "push" "-f"}
โœ…&runi {"git" "checkout" "main"}

solemn python
#

GUH

sullen fiber
#

emoji binding

solemn python
#

uiua scripting so cursed

sullen fiber
#

&cd ?!?!

#

ok interesting

#

hotswap cwd

warped dust
#

oh i was gonna make a joke about this quote they had

#

but its gone

#

uiua but MORE ()s

sullen fiber
#

what if Uiua had fewer ()

warped dust
#

also the new quotes are cursed

sullen fiber
#

show

warped dust
#

hold on they have 800mb wasm that takes half an hour to load

sullen fiber
#

so good

warped dust
native pewter
#

tf?

warped dust
#

this one is sane

sullen fiber
#

oh yea those are confusing i dont understand it

warped dust
#

cuz they look like lil faces

sullen fiber
#

oh,

#

oihhhhhhhhhhhhhh'

#

wtjeqaopfds

#

i didnt know repeat could do negative amount

#

before

#

wild

#

honestly uiua's most insanely cracked thing is

#

the inversion stuff

#

un and under

warped dust
#

its a social construct

sullen fiber
#

WHAT

warped dust
#

its literally jus getting whats defined as the inverse

sullen fiber
#

well yea

#

but its so ergonomic

warped dust
#

un sha512 when

sullen fiber
#

soooooooon

#

actually soon

#

today's aoc was unsha512

steady fog
#

@warped dust what if I threw a brick at you

warped dust
#

you will be parried

native pewter
#

rini uiuable?

warped dust
#

never

sullen fiber
#

i need typescript but uiua but rust macros

#

soooooon

native pewter
warped dust
#

uiua is fake stack lang

tranquil vapor
#

omg my solution so clean

#

using recursion

#

should i brute force part 2

native pewter
#

dirty!

steady fog
#

I hate rini I hate rini

#

vennnwhere is the repo

#

we need to make crystal de

native pewter
steady fog
#

nu

#

h

tranquil vapor
#

part 2 was so easy

#

was fun tho today

#

pretty fast ig? i just run every ray on its own no caching

delicate crane
#

0.13s?

tranquil vapor
#

ye

delicate crane
#

0.5 s for my solution

tranquil vapor
#

also crystal is fucking stupid

#

why is it | Nil

#

the switch is exhaustive...

steady fog
#

ven is good

tranquil vapor
#

my solution today was pretty verbose but i find it really clean

solemn python
tranquil vapor
#

what lang

solemn python
#

Rust but I did it badly

tranquil vapor
#

how is it so slow wtf

#

do u visit the same field many times?

solemn python
#

Probably because of the amount of vecs I make every step

tranquil vapor
#

my solution skips already visited fields

tranquil vapor
#

insane

#

do u use recursion or loop

solemn python
#

I crashed my KDE because memory leaking before I realized that initially

tranquil vapor
#

LOL

#

did u not immediately think of that

#

it was my first thought

solemn python
#

Nop

tranquil vapor
#

so i just immediately kept track of visited states

tranquil vapor
solemn python
#

I kept track but not direction and I only did so for calculating the answer after all beams

#

(loop)

tranquil vapor
#

how

#

i wouldnt even know how to do today with a loop tbh

#

unless u use lika a queue/stack?

solemn python
solemn python
tranquil vapor
#

ahh yeah

#

tbh today seems way easier in recursion

solemn python
#

blame the zeeter

tranquil vapor
#

so easy

#

thats essentially what i did

delicate crane
tranquil vapor
#

even if it did it wouldnt be hard

#

in js u can just

setImmediate(() => recurse())
#

to start a new stack

delicate crane
#

how did I not know that?

tranquil vapor
#
  1. it's not deprecated in nodejs
  2. it's only deprecated cause of stupid name
  3. it's extremely useful anyway
delicate crane
#

if it is depreciated because of stupid name, what is it's renamed replacement

tranquil vapor
#

none

delicate crane
#

I would rather not start using something in node then accidently use it in web when I shouldn't

tranquil vapor
tranquil vapor
#

Firefox doesn't have it so you need to polyfill

tranquil vapor
native pewter
tranquil vapor
#

setImmediate is probably the biggest "remember what they took from us" in browserland

steady fog
#

remember

delicate crane
#

is there a way to get import.meta.url of the file that imports the function in question?

a.ts

export function example() {
  console.log(?????)
}

b.ts

import { example } from './a'
example() // => a.ts
warped dust
#

no

#

simply make babel macro

sullen fiber
delicate crane
sullen fiber
#

if u used esbuild directly u could prob make it a plugin but yea theres nothing default afaik

delicate crane
#

ok

#

thanks

steady fog
#

@delicate crane hi

delicate crane
#

hi

steady fog
#

Allocate-object at (1) with a deferred type parameter requires either a type-spec or SOURCE tag or a MOLD tag

#

a mold tag

#

mold is so funny

#

it makes my gears turn

#

i love mold

native pewter
#

moldy brain

steady fog
#

yop

native pewter
#

he is propsering

#

speelig :(

steady fog
#

i will use

tranquil vapor
#

make onResolve keep track of the files it's resolving and make a virtual module like ~importer that just returns the last resolved file

tranquil vapor
#

no?

#

esm ๐Ÿ˜ญ

steady fog
#

ven loves fortran

native pewter
#

sometimes i hate js

#

that module shit is so garbage

steady fog
#

true

native pewter
#

reuire this import that

solemn python
#

import is so much better than uncommonjs at least

warped dust
tranquil vapor
#

oh even simpler then

steady fog
#

fortran is sooo weird

#

ven will read

warped dust
#

imports are cached though ud need to make one based on importer

native pewter
warped dust
delicate crane
warped dust
#

No

delicate crane
#

it works though

steady fog
#

ok i got an array of the lines now

#

@delicate crane question

steady fog
#

can i process each line on its own

#

or do i need to have access to other lines

delicate crane
steady fog
#

i would like to avoid a lines array

tranquil vapor
#

you need access to other lines

warped dust
#

in aoc 17 you meet breadan eigch and reimplement javascript on the netscape browser from scratch

#

the day lines being out of order now is so fucked

delicate crane
#

can typescript typing people help me?

I would like to make

function asThreaded(func): func // (same inputs and ouputs as input, but with Promise<> wrapping output
function asThreaded<I, O>(func: (...args: I[]) => O): (...args: I[]) => Promise<O> {

this is close, but it turns func(a:number, b:string) into func(...args: (number|string)[])

steady fog
#

can fortran people help me as well

native pewter
tranquil vapor
warped dust
#
function asThreaded<A extends any[], T>(f: (...a: A) => T): (...a: A) => Promise<T> {}
delicate crane
steady fog
warped dust
#

u didnt even type everything out

#

and made a typo

tranquil vapor
#

r u upset

warped dust
#

cant say anything ๐Ÿ™„

tranquil vapor
#

still faster

#

noob

warped dust
#

ur jealous

tranquil vapor
#

says the one malding rn

delicate crane
#

thanks

warped dust
#

tonight we will feast vee

steady fog
#

what

warped dust
#

she will be cooked

steady fog
#

WHO

warped dust
#

shes already so fat

steady fog
#

insane

#

rini will be cooked

steady fog
#

Hello Ven.

tranquil vapor
#

@steady fog @real hinge @solemn python @sullen fiber @hazy sinew gogogogo

steady fog
#

@tranquil vapor

tranquil vapor
#

HORROR PATH FINDING

steady fog
tranquil vapor
#

dijkstra day

steady fog
#

guh swift has the longest function names

#

componentsSeparatedByString

solemn python
steady fog
#

swift devs never heard of split

tranquil vapor
#

today seems weird cause it's basically dijkstra but with extra restriction that u must turn every 3 moves

#

idk if that makes it easier or harder

#

i probably won't do today

#

i hate path finding

#

i will brute force

sullen fiber
#

nah i'll do it in the morning

#

its better for me

steady fog
#

oh

#

NSString is native

native pewter
#

tf is today

tranquil vapor
native pewter
#

this makes me feel sick in the head

tranquil vapor
native pewter
#

this looks so stupid

tranquil vapor
#

dijkstra

native pewter
steady fog
#

lina

#

behave

native pewter
#

shut up zt

solemn python
#

I'm currently debating whether or not to do this now or tomorrow

steady fog
#

some believe that the fate of our worlds is inflexible

sullen fiber
#

i will A* in uiua tomrorow

tranquil vapor
#

actually the must turn every 3rd move doesn't matter much
|| basically just sort paths by length and then find the shortest path that doesn't have straight lines longer than 3 ||

real hinge
#

Its the end

steady fog
#

no

tranquil vapor
real hinge
#

I can no longer continue

steady fog
#

you will

#

rusher will motivate you mantika

solemn python
#

i love big o notation

native pewter
#

who couldve guessed!

real hinge
#

WE HATE DJAKSTRA WE HATE DJAKSTRA WE HATE DJAKSTRA WE HATE DJAKSTRA WE HATE DJAKSTRA

steady fog
#

why not simple DFS

#

does it really matter what alg

real hinge
#

Idk

#

I never used dfs either

#

aoc time

steady fog
#

i need to figure out how to make hashable point type in swift guhhh

#

io must make a struct

delicate crane
#

Where/how do I learn to solve problems like this

#

I am completely lost outside of bruteforce

steady fog
#

well

#

BFS, DFS, A*, Dijkstra

solemn python
steady fog
#

same

#

d17.swift:46:15: error: value of type 'Set<Point>' has no member 'append'

#

KILL

teal mountain
#

have u done all of this year in swift

steady fog
#

no

teal mountain
#

@proper totem GET OFF OF FORTNITE. SANTA NEEDS YOU

proper totem
#

i am playing with my sister blobcatcozystars

steady fog
#

@proper totem spoob

teal mountain
#

what are you going to do when she asks you why santa didn't bring her anything this year

proper totem
#

I am going to visit her so I will be the gift

#

also am going on a trip over the next week and will catch up

teal mountain
steady fog
#

wrap yourself up

proper totem
#

but finals and some other stuff ruined my head last week will recover soon uwu

teal mountain
#

aw ok, take care

steady fog
#

swift docs are good

#

i like

hazy sinew
#

vap is today uiuable

real hinge
#

I am fighting with rust compiler more than the problem

#

I hate this

steady fog
#

rust so bad

#

gyh the extra constraints make this harder

solemn python
#

I think my algorithm ran itself into the wall what

#

it just does 133 iterations and then dies after not being able to find minimum distance to the next point

#

maybe I should actually keep track of turning, maybe thats why that was introduced

steady fog
#

i hear minky

#

weird creature

#

guh i cant think of how to do this

#

swift lsp using 2 gb of ram

#

husk

solemn python
#

ok well I have a basic implementation of Dijkstra's algo

#

just need to add the parameter of not being able to go straight for too long somehow

steady fog
#

@solemn python help me

solemn python
#

how

solemn python
steady fog
#

im looking at the pseudocode on wikipedia

#

Graph.Edges(u, v) returns the length of the edge joining

#

wtf

solemn python
#

I ignored the pseudocode

steady fog
#

o

solemn python
#

just read the algorithm header

#

its easier to comprehend

steady fog
#

guhhhhhhhhh

#

you will be compounded

real hinge
#

I am trying to make something my own

#

following other algorithms feels harder

steady fog
#

youll have to if you want to do it in a reasonable time

real hinge
#

nฤฑo

steady fog
#

yes

#

ughhh

#

i understand i need to first get a list of all the paths

solemn python
#

I hate how reading the megathread everyone is like "yeah I just copy pasted my premade dijkstra algorithm"

real hinge
#

I found a shorter way

#

example is wrong

#

for some reason it starts at index 1

#

so bad

steady fog
steady fog
real hinge
steady fog
#

whats this image

real hinge
#

distances of each node

#

heat loss*

steady fog
#

did you sort it

#

it looks sorted

real hinge
#

sort wha

steady fog
#

wdym

real hinge
#

didnt sort anything

steady fog
#

guhhh I don't understand what these numbers are from

real hinge
#

guh whateve

steady fog
#

guh

real hinge
#

I feel sooooo close

#

but idk what to do

steady fog
#

im in bed now

#

idk either

real hinge
#

I think I got closer

#

WHATS THE PROBLEM AAAAAAAAA

steady fog
#

@real hinge

#

you must remember

#

sometimes slower is better

#

insallah

#

may the light show you the way

real hinge
#

amen

#

intrusive thoughts tell me to run real input and submit -1 of the answer

sullen fiber
#

its definitely sleepable

#

i'll read it later

#

zz

real hinge
#

@steady fog you love

#

imagine solving

#

while you can print it better

steady fog
#

beautiful

hazy sinew
#

github copilot should not generate strings

tranquil vapor
#

did someone solve yet

real hinge
#

HERP

#

my stupid code doesnt obey me

#

it finds a shorter path

#

(by nuking 3 step max rule)

hazy sinew
#

i threw today because i used bfs instead of dijkstra (ive never used dijkstra before)

tranquil vapor
#

adding automod rule s very \w+able that perma bans you

real hinge
#

javaable

#

just ban iuia blobcatcozy

#

this channel will become better place

tranquil vapor
real hinge
tranquil vapor
real hinge
#

I know none of the sorting algorithms

#

I implemented msort

tranquil vapor
#

they have 1000 algorithms prewritten

tranquil vapor
real hinge
#

lazy

tranquil vapor
#

or google rust dijkstra

real hinge
#

you will teah me

#

I found a pathfinding module

#

but I bet using these is as much complicated as writing one

tranquil vapor
#

i might skip today i hate dijkstra

real hinge
#

NO

tranquil vapor
#

and imo no fun in just implementing someone else's algorithm

real hinge
#

do not skip

tranquil vapor
#

wrong

hazy sinew
#

i bet he woke up and said "today is very dijkstrable"

#

he said today is very bfsable (it wasnt)

solar tide
#

just gotta be cleverer

hazy sinew
#

me when advent of code

real hinge
#

@tranquil vapor aoc time

tranquil vapor
#

nop

#

not home

#

did u solve it yet @real hinge

steady fog
tranquil vapor
#

SOVEEEE @real hinge

steady fog
#

VEN

real hinge
tranquil vapor
#

zt so lazy

steady fog
#

guhh

real hinge
#

my algorithm explodes for some reason

#

maybe I shouldnt have implemented my own algorithm

tranquil vapor
#

USE DIJKSTRA

#

INSANE

real hinge
#

HARD

#

TEACH ME AND I'LL USE

steady fog
#

VEN

real hinge
#

also I doubt djakstra itself would work

steady fog
#

TEACH ME TOO

real hinge
#

that max 3 way thingy causes the biggest issue

tranquil vapor
#

i just wrote this code for you @real hinge

use std::cmp::Reverse;
use std::collections::{BTreeMap, BinaryHeap};
use std::ops::Add;

type Graph<V, E> = BTreeMap<V, BTreeMap<V, E>>;

// performs Dijsktra's algorithm on the given graph from the given start
// the graph is a positively-weighted undirected graph
//
// returns a map that for each reachable vertex associates the distance and the predecessor
// since the start has no predecessor but is reachable, map[start] will be None
pub fn dijkstra<V: Ord + Copy, E: Ord + Copy + Add<Output = E>>(
    graph: &Graph<V, E>,
    start: V,
) -> BTreeMap<V, Option<(V, E)>> {
    let mut ans = BTreeMap::new();
    let mut prio = BinaryHeap::new();

    // start is the special case that doesn't have a predecessor
    ans.insert(start, None);

    for (new, weight) in &graph[&start] {
        ans.insert(*new, Some((start, *weight)));
        prio.push(Reverse((*weight, *new, start)));
    }

    while let Some(Reverse((dist_new, new, prev))) = prio.pop() {
        match ans[&new] {
            // what we popped is what is in ans, we'll compute it
            Some((p, d)) if p == prev && d == dist_new => {}
            // otherwise it's not interesting
            _ => continue,
        }

        for (next, weight) in &graph[&new] {
            match ans.get(next) {
                // if ans[next] is a lower dist than the alternative one, we do nothing
                Some(Some((_, dist_next))) if dist_new + *weight >= *dist_next => {}
                // if ans[next] is None then next is start and so the distance won't be changed, it won't be added again in prio
                Some(None) => {}
                // the new path is shorter, either new was not in ans or it was farther
                _ => {
                    ans.insert(*next, Some((new, *weight + dist_new)));
                    prio.push(Reverse((*weight + dist_new, *next, new)));
                }
            }
        }
    }

    ans
}
real hinge
#

gpt would write better code

#

absolutely terrible

steady fog
#

rust so ugly

real hinge
#

ven

#

HELP

tranquil vapor
steady fog
tranquil vapor
#

I WAS ABOUT TO SEND THAT

steady fog
real hinge
steady fog
#

horror

real hinge
#

I found exact same here

steady fog
real hinge
#

but he told us that he wrote hinself

steady fog
#

he lies

real hinge
#

impossible

steady fog
#

how

real hinge
#

I agree

steady fog
#

@real hinge hi

real hinge
#

death

tardy ore
#

that be very venable

sullen fiber
#

wow

#

how unlucky

#

the reason my day 15 part 2code was working on the example

#

but not the input

#

is cus 7*1+5*2+6*3 and 6*1+7*2+5*3 are equal

#

so my broken slot code didnt matter

tranquil vapor
#

wait wdym

sullen fiber
#

like in the example

#

in box 3

#

my slot code was broken, and i had the lenses in the wrong slots

sullen fiber
tranquil vapor
#

LOL

sullen fiber
#

yea pain

#

i swear it cant be that hard to make good examples

steady fog
#

I HAVE AN IDEA

#

I WILL USE MINKY TO SOLVE AOC

sullen fiber
#

yes

#

build ur input irl

#

put minky in start node

steady fog
#

yop

#

whats this

sullen fiber
#
Rosetta Code

Background: The man or boy test was proposed by computer scientist Donald Knuth as a means of evaluating implementations of the ALGOL 60 programming language. The aim of the test was to distinguish compilers that correctly implemented "recursion and non-local references" from those that did not.

I have written the following simple routine, wh...

#

LMAO WHAT IS THIS

steady fog
#

man or boy test

solemn python
#

Or the enby compilers???

sullen fiber
#

fr

steady fog
#

guh

#

theres a Heap class in a swift lib

#

but i wanna do enitrley stdlib

#

im going insane

#

i just want a heap ๐Ÿ˜ญ

sullen fiber
#

I DID DAY 15 PART 2 @tranquil vapor

#

finally

#

the fix was literally just โ -> โโ

#

cus i confused indices for ordinals AGAIN

steady fog
#

guh

solemn python
#

@steady fog @steady fog @steady fog @steady fog

steady fog
#

@prime pelican

#

GUIH

#

@solemn python

sullen fiber
#

oh

#

good timing

solemn python
#

I'll try and do it on the plane if I can

#

I should have internet and an outlet so rustc doesnt murder my battery

steady fog
#

why are you on a plane

solemn python
#

I'm not yet

#

But winter break

steady fog
#

i wanna cry

sullen fiber
#

you love

solemn python
#

Yeah it's dumb

steady fog
#

oh

#

i meant

#

my missing days

sullen fiber
#

oh no stars

solemn python
#

Oh

steady fog
#

:c

solemn python
#

That too

steady fog
#

i cant focus

sullen fiber
#

true

warped dust
#

going strong

steady fog
#

*** stack smashing detected ***: terminated

#

hep?

sullen fiber
#

LOL

warped dust
#

TROLELD

steady fog
#

i love stack smashing

sullen fiber
#

stack smashing

warped dust
#

ur call stack exploded

steady fog
#

how

sullen fiber
#

deref zst

#

@warped dust *&()

steady fog
#

my array was too short

warped dust
#

Box<()>

steady fog
#

for some reason it doesnt read the last char

solemn python
#

I like how p1 mentions the color but not why you need it
Funny p2 tease

#

Or it would be even funnier if it was irrelevant

sullen fiber
#

ok im not going in sane

solemn python
#

He should do that one day

steady fog
#

NO MORE DIRECTION BASED STUFF

#

PLEASEE

solemn python
#

It's so easy

steady fog
#

nop

sullen fiber
#

this is literally just

steady fog
#

i dont wanna do 2d array in C

solemn python
#

Just 2d vec

#

Or arr

#

Or list

#

Or whatever

sullen fiber
#

part 1 is just a repeat day

#

wtf

solemn python
#

Repeat of what

steady fog
#

oh no

sullen fiber
#

pipes part 2

steady fog
#

oh nononon i need to use malloc

sullen fiber
#

and another one

steady fog
#

im going to accidentally malloc all my ram

sullen fiber
#

oh im thinking of another year

sullen fiber
#

that had up down left right directions

steady fog
#

i love C

sullen fiber
#

ok time to do

#

today

steady fog
#

@sullen fiber

sullen fiber
#

wrong

steady fog
#

how

sullen fiber
#

sorry

steady fog
#

@sullen fiber enum Direction { UP = 'U', DOWN = 'D', LEFT = 'L', RIGHT = 'R' };

steady fog
#

ruld

sullen fiber
#

yea my fav order

steady fog
#

ulgy

sullen fiber
#

it is nice with complex numbers and trig

#

cus then its just 90 degress * the number

real hinge
steady fog
#

@real hinge hi

real hinge
#

I did every day except 17

steady fog
#

youre late

real hinge
#

Will try again innmy freetime tho

steady fog
#

i wanna get at least every part 1 done

real hinge
#

Anyway today doesnt seem bad

#

Just if x is inside the puzzle again

steady fog
#

need to figure out how to use malloc :)

real hinge
sullen fiber
real hinge
#

Malloc ia nothing

steady fog
#

i will malloc all my ram

real hinge
#

you just go sizeof(char or blabla) *8

steady fog
#

is sizeof the bits or bytes

real hinge
#

It just gives you x bytes of memory

#

Byte i think

steady fog
#

okay

real hinge
#

You cant allocate single bir

#

Thats why booleans take whole byte

solemn python
sullen fiber
#

i learned from

steady fog
#

ive never seen that before

sullen fiber
#

at first mostly this i think

steady fog
real hinge
#

We will succeed hopefully

steady fog
#

soon

#

mantika musk

sullen fiber
steady fog
#

oh i forgot to close the file posttroll

#

ok how do i deref a char**

solemn python
steady fog
#

incompatible pointer types passing 'char[20][128]' to parameter of type 'char **'

solemn python
#

But 3b1b is very cool

sullen fiber
#

i like it cus u can generate direction vectors from "RULB" index

#

like e^(i * index * pi/2)

solemn python
#

too many constants

#

scary

sullen fiber
#

not so bad in uiua โฟ:eร—iร—ฮท

solemn python
#

That's worse

sullen fiber
#

naa

solemn python
#

Why is the n droopy

sullen fiber
#

power

#

its exp

solemn python
#

Also what's i

sullen fiber
#

its i

solemn python
#

I mean the sqrt of -1 but in reference to the program

sullen fiber
#

like sqrt(-1)

#

its i

#

it does this e^(i * index * pi/2)

#

but index isnt in that code cus that code assumes the index is on the stack

solemn python
#

I can't just type i and expect rust to understand

sullen fiber
#

yea rust doesnt have complex number primitive

#

L

solemn python
#

Oh I see

sullen fiber
#

if it did

solemn python
#

It's just a some languages are good moment

sullen fiber
#

you could do it

solemn python
#

I'm sure I can find an implementation

sullen fiber
#

yea rust has op overloading

#

its good enough

#

im sure u can just raise a f64 to a complex power

#

yea u can cus

#

math

#

it only has one solution

steady fog
#

vap will be derefereneced

#

oh lol

#

i think i accessed memory outside of the array

#

itll be fine im sure

solemn python
#

The big number lib in rust has complex but not easy 4 + 3i syntax

#

You have to ::new

sullen fiber
#

is there like a macro

real hinge
#

C moment

steady fog
#

i will read your memory

solemn python
#

Hm I guess 3i doesn't count as multiplication does it, so it would be hard to do fancy syntax without a proc macro

rustic orchid
sullen fiber
#

can u like

solemn python
#

And at that point just use a tuple lol

sullen fiber
#

4 + 3*i

real hinge
rustic orchid
#

uiua very curse

sullen fiber
#

not uiua

solemn python
#

I guess that would get PEMDAS'ed so sure

real hinge
#

How

sullen fiber
#

rust

solemn python
#

Maybe I'll mess with it later but meh,

sullen fiber
#

actually it'd be i()

solemn python
#

tuples are fine for now

sullen fiber
#

cus the num crate

#

uses a function to create i

#

theres no constant i guess

real hinge
#

@steady fog I am waiting lesson to start

steady fog
#

do

real hinge
#

So I can do aoc

solemn python
sullen fiber
real hinge
#

I dont want to waste my computers battery while oj break

#

It only lasts 3-4 hours

sullen fiber
steady fog
#

i cant return the array

#

thats guh

teal mountain
#

the yearly visualisable problem

rustic orchid
#

@steady fog i^3

steady fog
#

@rustic orchid

real hinge
#

Last year I had lot of fun making that

rustic orchid
#

@steady fog sand problem

teal mountain
steady fog
#

mantika moment

real hinge
#

I LOVE Windows 10

rustic orchid
#

yop

#

best operating system

steady fog
#

oh god

#

i could do a 1D array and use pointer arithmetic

rustic orchid
#

zeet talking like an actual person

teal mountain
rustic orchid
#

@real hinge windows 10 user

solemn python
daring marlinBOT
real hinge
steady fog
#

@real hinge@real hinge

hazy sinew
#

@sullen fiber today is so uiuable

rustic orchid
#

oldest windows keybind

solemn python
#

Zt will run the shortcut

sullen fiber
#

this is true

#

i have already wrote most the code i need before

#

this is just

real hinge
#

I once tried

#

Hardly done it

steady fog
real hinge
#

They should make it win + L tbh

hazy sinew
#

i tried doing it using my custom grid and miserably failed for some reason

solemn python
#

Linux users are cool

steady fog
#

port to linux kernel

real hinge
steady fog
#

some beleive the fate of our worlds is inflexible

real hinge
sullen fiber
#

||unbounded drawing from 2019 day 3, kernels from day 3 this year, and pipes part 2 for filling||

rustic orchid
solemn python
#

Do you even need to ||flood fill||
||Can't you just iterate over all lines, finding difference between boundaries||

real hinge
#

I will try the laburnth tactic

hazy sinew
#

you can do ||exactly the same thing we did in day 10||

rustic orchid
#

@real hinge will press ctrl shift alt win [all the keys]

real hinge
#

Yea

rustic orchid
#

will not regret

sullen fiber
#

||yea thats what i did for part 2 pipes anyways||

hazy sinew
#

or ||shoelace formula||

real hinge
#

Count Left blocks blabka

sullen fiber
#

||but u need corner information for edge cases iirc||

hazy sinew
#

wdym

rustic orchid
#

you love CSAW + o

steady fog
#

oh

sullen fiber
#

i guess true but thats so specific im scared it wont be applicable to part 2

hazy sinew
#

i mean i did it using ||flood fill|| initially for some reason im now rewriting it to use my custom grid and be cool

sullen fiber
#

that would be so nice in uiua tho

#

im gonna do it simply because elegance

steady fog
#

call to undeclared function 'getline'; ISO C99 and later do not support implicit function declarationsC/C++(clang-diagnostic-implicit-function-declaration)

#

@real hinge

rustic orchid
#

I got it just fine using ||will be doing aoc next year but not this one unfortunately||

hazy sinew
steady fog
#

compiles just fine

#

i will ignore

sullen fiber
#

||oh ok im based then||

real hinge
#

You need to rewrite solution

hazy sinew
#

i thought we would be mixing colors but no ๐Ÿ˜ญ

hazy sinew
real hinge
steady fog
#

it workss

sullen fiber
#

(null)(null)(null)(null)(null)

real hinge
#

Zt finally parsed input

#

Impressive

#

One of the hardest tasks in C

rustic orchid
#

(null)

hazy sinew
#

||im storing my grid in a Map<Point, Char>, then iterating from minrow to mincol and doing windings count, i have now come to the realization that i was counting the path too which is why my answer was wrong||

steady fog
#

how do i get the size of the pointer array

hazy sinew
#

why is it null null null

steady fog
#

printing non existant items

hazy sinew
steady fog
#

prints only a few of the items

hazy sinew
#

wait its an array of pointers?

steady fog
#

yes

#

a pointer to pointer

hazy sinew
#

use a different language

steady fog
#

never

rustic orchid
#

@steady fog did you do jython yet

steady fog
#

whats jython

hazy sinew
#

why are u using a pointer array

rustic orchid
steady fog
real hinge
#

Zt will use sscanf

#

To parse

hazy sinew
hazy sinew
rustic orchid
steady fog
#

why didnt that ping me

hazy sinew
#

did u do it in kotlin yet

rustic orchid
#

attached to link

steady fog
#

oh

rustic orchid
#

idk

steady fog
#

i havent

#

ig ill do tomorrow

hazy sinew
#

do today in kotlin

steady fog
#

nop

sullen fiber
#

fire

steady fog
#

C

#

C my beloved

hazy sinew
#

what did u guys use to store the grid

steady fog
#

2d array

sullen fiber
#

i probably wont

rustic orchid
#

hidden discord feature how to abuse this now

sullen fiber
steady fog
#

double free or corruption (out)

sullen fiber
#

ooo i dont think i need a grid for this one

#

fire

hazy sinew
#

uiua has complex nums?

sullen fiber
#

yea

hazy sinew
#

i am switching to uiua

sullen fiber
#

LOL HUGE

hazy sinew
#

no im not

sullen fiber
#

YOU WILL

steady fog
#

nop

#

im going to use so much ram

#

mantika will run my solution

real hinge
#

YOU DONT HAVE TO SPOILER

#

No one can understand that

sullen fiber
#

you might understand it

real hinge
#

NO

steady fog
#

@real hinge h

real hinge
#

Hidrogen

steady fog
#

you cannot spell

real hinge
#

I cna

#

Isnt this how its spelled

steady fog
#

0x555555559cf0 "X", ' ' <repeats 98 times>

#

it worksss

real hinge
#

Oooh its hydrogen

#

Its hidrojen in turkish

steady fog
#

maybe i could just use booleans

#

false = terrain
true = digged

real hinge
#

Your computer doesnt have much time left

steady fog
#

i know

#

so do you

real hinge
#

You will soon write data to random memory and corrupt your OS

steady fog
#

YOP

#

oh my god C doesnt have bool

real hinge
#

Use int

#

or char

steady fog
#

i found

#

#include <stdbool.h>

real hinge
#

Char is smaller technically

steady fog
#

you are scared

real hinge
#

Yop

steady fog
#

mantika moment

#

why is it just true

real hinge
#

is there sscanf like thing in rust

steady fog
#

maybe

real hinge
#

I dont like regex

#

so bad

#

hm do I configure grid size dynamically or

#

statically trolley

steady fog
#

im doing dynamically

hazy sinew
sullen fiber
#

simple just have no grid

#

oh ur right

#

part 2 is so silly

real hinge
#
let grid_length: i32 = values.clone().filter(|(a,b)| *a == "R").map(|(a,b)| b.parse::<i32>().unwrap()).sum();
let grid_height: i32 = values.clone().filter(|(a,b)| *a == "D").map(|(a,b)| b.parse::<i32>().unwrap()).sum();
#

I am genius

sullen fiber
#

ok my part 2 code needs cleaning

hazy sinew
#

for some reason its not counting these 2 points

real hinge
#

wait pipe way to get the dots inside wont work

#

probably

hazy sinew
#

WAIT

#

the day 10 part 2 cant be copypaste

#

d

real hinge
#

yea

#

I will floodfill ig

hazy sinew
#

how tf do i do it t hen

#

without floodfill

real hinge
#

well uhh

hazy sinew
#

do i HAVE to shoelace

real hinge
#

idk