#AdVENt of Code

1 messages Β· Page 1 of 1 (latest)

delicate crane
sullen fiber
#

@true hatch @exotic meadow @native pewter

#

@drifting hornet @solemn python @tacit wigeon

#

@proper totem @warped dust

#

forceful add

solemn python
#

Yooooo

sullen fiber
#

wait could i have done that with an edit @high lintel

#

omg i could have

#

sorry

solemn python
#

Was wondering when this would be a thing

#

I just did it

tacit wigeon
solemn python
#

Crazy

sullen fiber
#

i finally did it

#

that took a while

solemn python
#

I spent entirely too long making overly complicated solutions to part 2

#

Then realized I was an idiot

delicate crane
tacit wigeon
#

WAIT IT STARTD?

sullen fiber
#

same

#

yes silly its december

solemn python
delicate crane
somber smelt
sullen fiber
#

rate my solution

tacit wigeon
#

how do i

#

do anything :3

sullen fiber
#

click day 1

delicate crane
solemn python
sullen fiber
delicate crane
#

I don't have to look at an image at least

sullen fiber
#

||```
Lines ← βŠœβ–‘β‰ @\n. &fras "input.txt" # Lines

GetDigits ← Γ— βŠ™(-@0) ≀@9.βŠ”
GetValue ← + Γ—10 βŠƒβŠ’(βŠ’β‡Œ) β–½β‰ 0.

Part 1

/+ ≑(GetValue GetDigits) Lines

Part 2

Words ← {"zero" "one" "two" "three" "four" "five" "six" "seven" "eight" "nine"}
GetNumbers ← /+ ≑(Γ—βŠ—:WordsβŠ™(βŒ•βˆ©βŠ”).)Words
/+ ≑(GetValue +βŠƒ(GetNumbers)(GetDigits)) Lines

delicate crane
#

@steady fog advebnt of code here

solemn python
#

You should pin the code here

#

1776680-321d3007

steady fog
#

tyminky

tacit wigeon
#

i dont even get the question wahhhhhhh

sullen fiber
tacit wigeon
#

where the fuck is the second 7

delicate crane
sullen fiber
#

7 is the last and first digit

tacit wigeon
#

oooooooooooooooooooo

#

i get it

solemn python
delicate crane
tacit wigeon
#

ok what language

#

uhhhhhhhhhhhhhhhhh

solemn python
#

I did rust because yes

warped dust
#

malware thrwad

tacit wigeon
#

JAVA

solemn python
tacit wigeon
#

AAAAAAAAAAAAAAAAAAAA

sullen fiber
#

HEY

#

look at my solution imma show u but like in a normal way

somber smelt
solemn python
#

Why

#

I like rust

warped dust
#

im asleep

somber smelt
#

im doing it in swift

solemn python
#

My code is ass but we aren't being graded on this so who cares

somber smelt
#

part 2 gave me trouble

delicate crane
#

OK ima sleep now. Remind me tomorrow to implement testing based on the examples

solemn python
#

If it works it works

solemn python
delicate crane
solemn python
#

Yeah

delicate crane
#

Just like normal tests

sullen fiber
tacit wigeon
sullen fiber
#

||i just did it just in case||

#

||and it made my math easier||

solemn python
#

I just ignored 0 completely

tacit wigeon
#

no as in zero i meant like words that are numbers

solemn python
#

Yes that too

tacit wigeon
#

guh

sullen fiber
#

yea they dont show up

solemn python
#

It explicitly lists all valid cases, one of which is not zero

sullen fiber
#

i just did it so that ||.indexOf("one") === 1||

delicate crane
sullen fiber
#

u cant

solemn python
#

You dont

#

You solve part one like the epic coder you are

delicate crane
#

Then the dream of tests in my hot reloads is dead

tacit wigeon
sullen fiber
#

yes

tacit wigeon
#

alr

sullen fiber
#

also ||eightwo is 82||

tacit wigeon
#

ty

sullen fiber
#

they dont tell you that and it made me die a lot

tacit wigeon
#

horror

solemn python
#

They should have made clearer the situation of like ||5twone|| because that confused me for a bit

#

But I figured it out eventually

#

Though that might also have been just me doing stuff the hard way

#

Anyways eepy time

somber smelt
#

yeah

delicate crane
#

Is AOC solution always a number?

warped dust
warped dust
sullen fiber
#

uhh

delicate crane
sullen fiber
#

because everything is a command

#

i guess

warped dust
#

vavjkwars

sullen fiber
#

2 is a command to push 2 on the stack

warped dust
#

IRTS BACKWRS

sullen fiber
#

if u do 2 3 4 you'd expect it to be on the stack in that order

warped dust
#

the answer is the author is stupid actually

sullen fiber
#

..../////////////////////

#

maybe

#

i dont have anything to compare it to

warped dust
tacit wigeon
warped dust
#

they dumb

#

DUUMB

#

uiua is DUUUMB

sullen fiber
#

nahh

#

just arabic brain it

somber smelt
#

are aoc inputs always split by newlines

warped dust
#

trje

sullen fiber
#

very often they are but i mean its not always a 1d list

somber smelt
#

shrug

sullen fiber
#

u can go thru last years to see like

somber smelt
#

i added a convenience var to access lines of input

#

its fine

sullen fiber
#

the range of input diversity

#

sometimes its like

warped dust
#

$<.each on top

sullen fiber
#
a
b
c

d
e

f
g```
#

groups of lines

warped dust
#

i will golfed ruby pill vap

sullen fiber
#

You should think of it like any of the numerous other languages that put functions before their arguments. This group includes languages of vastly different kinds, like C, Haskell, and Lisp.

#

yea this makes sense

#

oh that page made me realize how to remember the order of - and div

rain bloom
#

love

#

ugh im supposed to be sleeping

sullen fiber
#

me

rain bloom
#

time for aoc

sullen fiber
#

have FUN

#

test

tranquil vapor
#

what lanuage do iuse

rain bloom
#

rust

sullen fiber
#

uiua

tranquil vapor
#

shopify horror

rain bloom
#

shopify loves ruby

tranquil vapor
#

WHY DOES RUBY ON WINDOWS REQUIRE MSYS2

#

jesus

#

😭

tacit wigeon
#

im going to hurt somebody

rain bloom
#

i am a menace using rust

#

elegance is not my problem

tranquil vapor
#

why is the rtuby language server shit

tacit wigeon
#

AAAAAAAAAAAAAAAAAAAAA

tranquil vapor
#

LOL

#

IM SO DUMB

tranquil vapor
#

guh its so over

#

i wrote code and it should work but it doesnt work

#

i think its cause of some weird ruby thing i dont know about

warped dust
#

you wanna be me so bad

tranquil vapor
#

wait what

#

i found out why

#

why is it not matching the one

warped dust
#

overlaps

tranquil vapor
#

i thought regex also matched overlaps

warped dust
#

trolled

#

i ran into exactly this

rain bloom
#

rust doesnt have that issue for whatever reason

tranquil vapor
#

FINMALLY

#

god the overlapping groups ruined me

warped dust
rain bloom
#

insane

tranquil vapor
#

WTF IS THAT

warped dust
#

ruby

#

i love ruby

tranquil vapor
#

i also used ruby

#

but mine is saner

warped dust
#

wrong

#

my code is so concise and readable

tranquil vapor
#

much saner ruby

#

|| i initially just did first = line[re] and last = line.reverse[re]. then i realised that will turn two into owt xd

i will shrimply reverse my regex too
||

#

should i start a private leaderboard

warped dust
#

we have

warped dust
#

from last year

tranquil vapor
#

horror it still has from last year

#

i kinda want a reset board

#

xd

warped dust
#

why tho

#

its only scores this year

tranquil vapor
#

wdym

#

it still shows last years points here

warped dust
#

whar

tranquil vapor
#

WDYM

warped dust
#

it doebt

tranquil vapor
#

girlie..

warped dust
#

this year

#

theres only one day

tranquil vapor
#

im confused

#

oh i thought the number indicated how many stars u have in total

#

and persisted from last year

warped dust
#

dumbas

tranquil vapor
#

should we make a proper aoc channel

#

i think itd be good idea

sullen fiber
#

AGREE

#

thread too hidden imo

warped dust
#

adveht of car

sullen fiber
#

there are prob devs that would join in if they saw on channel list

tranquil vapor
#

but even normal channel is hidden cause of insane onboarding

warped dust
#

cta

sullen fiber
#

oh ig

#

i dont use that stuff

tranquil vapor
sullen fiber
#

yop

warped dust
tranquil vapor
#

dont we

warped dust
#

nop

sullen fiber
#

well

#

if they can pass the aoc

#

they probably are fine

tranquil vapor
#

yoiure kinda right ig

warped dust
#

but then you have dumb people in the channel

sullen fiber
#

u can ping cute people

#

and tell them

daring marlinBOT
# sullen fiber also rate https://github.com/Vap0r1ze/aoc/blob/2023/01/solve.ua

**solve.ua: **

Lines ← βŠœβ–‘β‰ @\n. &fras "input.txt" # Lines

GetDigits ← Γ— βŠ™(-@0) ≀@9.βŠ”
GetValue ← + Γ—10 βŠƒβŠ’(βŠ’β‡Œ) β–½β‰ 0.

# Part 1
/+ ≑(GetValue GetDigits) Lines

# Part 2
Words ← {"zero" "one" "two" "three" "four" "five" "six" "seven" "eight" "nine"}
GetNumbers ← /+ ≑(Γ—βŠ—:WordsβŠ™(βŒ•βˆ©βŠ”).)Words
/+ ≑(GetValue +βŠƒ(GetNumbers)(GetDigits)) Lines

warped dust
#

fire

tranquil vapor
#

WHAT IS THAT

warped dust
#

ancient hieroglyphics

sullen fiber
#

linear algebra language

tranquil vapor
#

you didnt read instructions

#

u werent supposed to include "zero"...

sullen fiber
#

i did

tranquil vapor
#

they should have put zero just to catch people like u

sullen fiber
#

NO

#

i figured there would just not be a zero

warped dust
#

treye

sullen fiber
#

i added it cus it made math easier

tranquil vapor
#

bestie where does it say zero...

sullen fiber
#

IT MADE

#

MATH

tranquil vapor
sullen fiber
#

EASIER

#

YE

tranquil vapor
#

weiiird

sullen fiber
#

YEA

#

YEA

#

YEA

yEA
AEYA
YEA
e

#

ya

#

eay

warped dust
#

i did _ one two

#

troll

sullen fiber
#

oh uyrkinda based

tranquil vapor
#

real ones do
|| ```rb
i = nums.index num
return (i + 1).to_s unless i.nil?

sullen fiber
#

i could have done null byte

#

@\0

native pewter
#

real ones overslept

warped dust
#

real ones got insomnia

#

(help

sullen fiber
#

real ones going to sleep

native pewter
#

gn

sullen fiber
#

nini

tranquil vapor
#

do ruby users actually use the no bracket syntax? as in puts banana.to_s.reverse.last over puts(banana.to_s().reverse().last())

#

its like the anti-lisp

#

:3

sullen fiber
#

@warped dust tomorrow i will do it in qilang

warped dust
#

i think so but not when there's too many nested calls

#

wtf is that chinese ass lookin apl dialect namr

sullen fiber
#

Dyalog

#

BQN

warped dust
#

sorry i got racist

sullen fiber
#

those are the only ones i know

tranquil vapor
#

this is so bad

File.foreach(file) do |line|
end

real ones use

File.foreach file do |line|
end
warped dust
#

{|line| }

tranquil vapor
#

nop

warped dust
#

yop

#

actually omit the ||

tranquil vapor
#

can u

warped dust
#

use _1 :3

#

yes

tranquil vapor
#

malware

tranquil vapor
warped dust
#

vee loves $<.each{puts _1}

tranquil vapor
#
line.scan(re).flatten
#

how do i rewrite this without ()

warped dust
#

dont

tranquil vapor
#

HOW

warped dust
#

cant

tranquil vapor
#

:(

#
line.scan re .flatten
#

they should make this work

warped dust
#

(line.scan re).flatten

tranquil vapor
#

how do i remove parens here

(parse(m.first) + parse(m.last)).to_i
#

mmm

Integer parse(m.first) + parse(m.last)
warped dust
#

parse(m.first).+parse m.last

#

nop

#

i thnk

tranquil vapor
#

NO

warped dust
#

;33

tranquil vapor
#

LOL do you really have to PascalCase global variables

warped dust
#

where

tranquil vapor
#
thing = 42
Thing = 42

def banana
  puts thing # doesnt work
  puts Thing # works
end
sullen fiber
#

You guys aren't using matrices enough

#

Needs more matrix

warped dust
#

says the scalar integer

sullen fiber
#

Integer 😳

tranquil vapor
#

malware

#

this syntax is so cursed

def parse num 
    i = Nums.index num
    return String i + 1 unless i.nil?

    return num
end
warped dust
#

vee loves $><<"h"<<"e"<<"w"<<"w"<<" "<<"o"<<"\n"

tranquil vapor
#

STOP

#

kill

#

c++ moment

warped dust
#

i and String i + 1 or num

exotic meadow
#

WAIT IT STARTS TODAY

warped dust
#

started

#

u lost already

exotic meadow
#

AAAAA

sullen fiber
#

5h ago

exotic meadow
#

I’m on a bad timezone for this

sullen fiber
#

It's ok there's 25 more days

exotic meadow
#

6am

sullen fiber
#

Same

exotic meadow
#

I’m not awake at 6

sullen fiber
#

Same

#

Except when AOC keeps me awake

warped dust
#

its 7 rn

#

rate

exotic meadow
sullen fiber
#

Is that utc

warped dust
#

727 am

#

WJRN YHO

#

FCNNK

sullen fiber
#

Qhat

warped dust
#

i wana work on beam so bad

#

i love erlabg

#

but my brain isnt working but i also CANT SLEFB

sullen fiber
#

Erlang has you hostage

#

Watch a video then do another sleep attempr

warped dust
#

im beinf held hostage to write a good etf lib bc NONE exist for rust

warped dust
sullen fiber
#

Holy

warped dust
#

true

#

i know what i should actually work on

#

deadly viruses

#

makin bioweapons

#

worse than smallpox

somber smelt
warped dust
#

vee will be patient zero

tranquil vapor
#

why did they start day 1 with such a meanie one

warped dust
#

truue

tranquil vapor
#

i can imagine many people not figuring it out and immediately getting annoyed xd

somber smelt
#

fr it was so lame

warped dust
#

theyre making the prompts more yap to prevent the ai ppl

tranquil vapor
#

fuck people who use ai on the leaderboard

#

or even use ai at all for this

#

why would u do that

high lintel
#

omg i thought each line is guaranteed to have two digits

#

there goes my cute 1loc solution

rain bloom
#

imagine using ai

#

actually dogshit mentality

#

ruining the fun for everyone else

native pewter
#

purescript seems funny

#

transpiles to golang too lmao

#

its not about winning

native pewter
#

@glacial abyss

#

you will do

#

in js

#

ill help you even

glacial abyss
#

what is this

native pewter
#

its like a small coding challenge for every day of advent :3

#

they get progressively harder, so you have time to slowly learn the language

fading mortar
#

I am so close

glacial abyss
#

if theres something in AOC that can theoretically be done in css, ill make it in a discord theme trolley

native pewter
#

im gonna hit you with a rock

#

do it in js to finally learn

fading mortar
#

funny one line
||

console.log(input.map(x => x.replace(/one/g, "one1one").replace(/two/g, "two2two").replace(/three/g, "three3three").replace(/four/g, "four4four").replace(/five/g, "five5five").replace(/six/g, "six6six").replace(/seven/g, "seven7seven").replace(/eight/g, "eight8eight").replace(/nine/g, "nine9nine").replace(/\D/g, "")).map(x => x[0]+x[x.length - 1]).map(x => +x).reduce((partialSum, a) => partialSum + a, 0));```

Of course `input` has to be in the form `["abc", "xyz"]`
||
sullen fiber
#

You will include_str!

#

Macro for embedding file as a string

solemn python
#

Yeah that's what I used

#

Then just gitignored /**/input.txt

#

Yeah

#

Relative to the file it's included in

sullen fiber
#

It's not a good idea in most cases

#

It's only good for static assets

#

That u want to include in ur program at build time

#

Weeeee

warped dust
#

u suck

#

fs::read(path)

#

ur blind as hell

#

literally just read

#

fn name

sullen fiber
#

is rust docs actually blocked 😭

#

wow amazing

delicate crane
fading mortar
#

Yeah that works

solemn python
#

I was doing replacements at first but I realized it was so much easier to just treat the input as immutable and just use indexes

delicate crane
sullen fiber
#

same

#

well i was using an array-based language so i had to or else it was too complicated

tranquil vapor
#

my solution sooo easy but i got screwed over by the same thing everyone else got screwed over by

delicate crane
#

I don't know how everyone got so screwed by that

#

It took me like 5 seconds to fix once I realized there was overlap

sullen fiber
#

because they dont give u the edge case that suggests otherwise

tranquil vapor
#

the issue is realising that is a thing

#

i only realised cause i manually checked every line and what my code was finding

tranquil vapor
#

i only had to check like 20 lines but still annoying xd

sullen fiber
#

im just glad i didnt have to get that far and someone told me

delicate crane
sullen fiber
#

yea that makes sense

#

but not knowing how that wasn't enough for everyone is silly

delicate crane
#

When AOC leaderboard

sullen fiber
#

true

tranquil vapor
#

mine didn't have any overlaps

sullen fiber
#

they did it was an example

#

like eightwo5

#

said it would be 85

#

but didnt mention that the full list would be 8 2 5

tranquil vapor
#

oh there is

#

i just didn't notice

#

everyone gets different example i think

sullen fiber
#

nah

#

i just made the one i said up

delicate crane
tranquil vapor
#

r they?

#

my example was

two1nine
eightwothree
abcone2threexyz
xtwone3four
4nineeightseven2
zoneight234
7pqrstsixteen
delicate crane
#

last digit on each line. For example:

two1nine
eightwothree
abcone2threexyz
xtwone3four
4nineeightseven2
zoneight234
7pqrstsixteen

native pewter
#

is this punishment for picking a functional language

#

filter :: (String -> Boolean) -> String -> String

#

im going insane

#

wait is it using the wrong filter

solemn python
#

||I just check the char index of 0-9, "one"-"nine" and sort||

delicate crane
#

That would take like 5 more lines of javascript to implement than running replaceAll

#

And my current solution is 4 lines of actual code

solemn python
#

I mean if you do the word number word trick sure, I was just having issues with prioritizing replacements

#

And I didn't think of that trick

sullen fiber
native pewter
#

what

sullen fiber
#

check that one out

native pewter
#

im still fighting the purescript compiler explod

sullen fiber
#

oh my b

native pewter
#

lmao mb tail doesnt do what i thought it does

#

this language is so shit google autocorrects purescript to typescript

#

FINALLY DID IT

somber smelt
#

@unique hearth im abducting you

sullen fiber
#

it worked

#
RunInstruction ← +4: ⍜⊑; βŠƒ(:β‹…βŠ™βˆ˜)(∘) (∘|+|Γ—) βŠ™βŠƒ(⍘[βŠ™βˆ˜] ⊏ βŠ™. ↙2)(⊑2) βŠƒ(⊑0)(β†˜1) βŠ™: ↙4β†˜,,
#

@warped dust uiua cpu

#

i should really comment my code

#

i think im gonna start doing julia

native pewter
sullen fiber
#

part 2 is FUCKED UP and im not doing it in uiua at all

#

no damn way

#

i need some sort of polynomial contruct to do this

sullen fiber
#

i guess a matrix could be a polynomial but

#

thats fucked up

#

wait maybe

warped dust
#

finished making my code more readable ||```rb

pt1

p$<.map{f,*,l=_1.scan(/\d/)*2
eval f+l}.sum

pt2

d=%w?_ one two three four five six seven eight nine?+(?0..?9).to_a
p$<.map{f,,l=_1.scan(/(?=(#{d?|}))/).flatten2
d.index(f)%10
10+d.index(l)%10}.sum

#

\K doesnt work like i thought πŸ’”

#

would be 2 chars less..

warped dust
sullen fiber
#

it does one of those 3 functions

warped dust
#

dont vapsplain i know its a switch

sullen fiber
#

YOUR MOM

warped dust
#

i need to actually learn uiua

sullen fiber
#

do\

#

just read the tutorial

#

do basic things

#

and then do like some day 1 aoc puzzle

warped dust
#

uiua will be real on day 4

sullen fiber
#

fear

native pewter
sullen fiber
#

true

sullen fiber
#

oh i did today in uiua

unique hearth
#

a nice

sullen fiber
#

btw

unique hearth
sullen fiber
#

it looks probably the same?

warped dust
#

uiua.vim when

sullen fiber
#

sec lemme get the video

unique hearth
#

ah neat

sullen fiber
warped dust
#

why is wee wuh webpage so sloww

sullen fiber
#

i should comment my code like you

unique hearth
sullen fiber
#

im glad we have another uiua user in here

#

!!

unique hearth
#

i made a p1-only solution that is really nice though /+≑(+Γ—10⊒:βŠ’β‡Œ.▽≀9.-@0)βŠœβ–‘β‰ , @\n

sullen fiber
#

yea thats fire

unique hearth
sullen fiber
#

haha you used it

#

but also

unique hearth
#

ugh

#

yeah i did

sullen fiber
#

what is this

unique hearth
#

but not where it matters

sullen fiber
#

≑(|1 )

unique hearth
#

function signatures

warped dust
#

polygot.vim doesnt know uiua πŸ‘Ž

#

worst plugin

unique hearth
#

because i do /∘ it can't infer the amount of arguments

sullen fiber
#

ohh

#

|1 a shorthand

unique hearth
#

yeah

sullen fiber
#

for 1.1?

unique hearth
#

yes

sullen fiber
#

FIRE

#

FIRE

unique hearth
#

The second number is optional. If it is not given, it is assumed to be 1.

sullen fiber
#

oh yea also i assume u ran into that bug

unique hearth
#

i think formatter actually does this shorthand automatically

sullen fiber
#

where find fails if the needle is larger than the haystack

unique hearth
#

didn't run into that exact issue but a similar one yeah

sullen fiber
#

ah i saw u accounted for it and assumed

#

that particular issue with find was fixed in main branch

#

i had to wait 10m for uiua to recompile to do part 2 lmao

#

i had some fucked up attempts

unique hearth
#

ah i am running uiua from source so i probably wouldn't have run into this issue then

sullen fiber
#

yea true

sullen fiber
#

at first i was like trying to tokenize it and accumulate it

unique hearth
#

oh replacing

sullen fiber
#

it was scary

unique hearth
#

this looks not good yeah

warped dust
#

UIUA THREADING

sullen fiber
#

yea uiua does have threads LOL

unique hearth
sullen fiber
#

ah yea fair

unique hearth
#

oh i should make it multi threaded and see if that makes it run through the bigboy at an acceptable pace

#

probably not

sullen fiber
#

after a day or two of using uiua

#

its mostly not that bad to read if things are spaced well

unique hearth
#

mhm

sullen fiber
#

but stack manipulation is definitely hard to track

unique hearth
#

it's a lot better than it was in the beginning

sullen fiber
#

yea i heard there were ocean operators or smth

warped dust
#

😭😭😭😭😭😭😭😭😭😭😭

sullen fiber
#

and they got removed

warped dust
#

bro said dialog

sullen fiber
#

wait

unique hearth
#

ocean was for arrays but that was a thing yeah

sullen fiber
#

nvm its really bad i see

warped dust
#

&sc

#

&sc reads a line

unique hearth
#

i had to basically relearn uiua because it's so actively developed almost nothing was like how i remembered it

sullen fiber
#

yea aa

unique hearth
#

it's all improvements though

sullen fiber
#

one thing i really like is planet notation

#

also under and inverse

#

are pretty magic

warped dust
#

reach is deprecated

#

this lang sucks

sullen fiber
#

what is reach

warped dust
#

dig but twice

sullen fiber
#

WHAT IS DIG

warped dust
#

planet..

sullen fiber
#

oh ur using the acronym

#

dip id gap

#

?

warped dust
#

βŠ™βŒ£βŠ™

sullen fiber
#

oh u meant dip

#

true true

warped dust
#

dip dig

#

same

sullen fiber
#

wrong

#

type dig

warped dust
#

they should rename

sullen fiber
#

you will see

warped dust
#

dip makes no sense

sullen fiber
#

type dig

warped dust
#

unkwnown

sullen fiber
#

oh true cus its not

#

real

#

has to end in i

#

digi

#

diggigigididiigiidigi

#

wtf scam that doesnt work

warped dust
#

digidigidiggi

#

βŠ™βˆ˜β‹…βˆ˜βŠ™βˆ˜β‹…βˆ˜βŠ™βˆ˜β‹…β‹…βˆ˜

sullen fiber
#

oh cant have 2 i in a row

#

makes sense

warped dust
#

Finished release [optimized] target(s) in 7m 42s
Installing /home/rini/.local/share/cargo/bin/uiua

#

wee wuh

sullen fiber
#

true

#

⍘[βŠ™βŠ™βˆ˜] to unpack a 3-tuple into the stack is so fire

warped dust
#

fuckin underlines in strings are format strings

sullen fiber
#

isnt it just with like

warped dust
#

hey guys i just did aoc day 1 in uiua

#

||```
[
β–‘"ruby" β–‘"-e" β–‘
$ p$<.map{f,*,l=_1.scan(/\d/)*2
$ eval f+l}.sum
]
;&runi

sullen fiber
#

if u wanna auto box ur elements u can use {}

#

also LOL

warped dust
#

why does do look like that

#

⍒

#

:β–Ή

sullen fiber
#

⍒

#

do

native pewter
sullen fiber
#

fork

#

the fork

warped dust
#

how tf do i read stdin into an array

sullen fiber
#

are u readlining til empty?

warped dust
#

trying to

#

do SUCKS

sullen fiber
#

idk how stdin works i suggest filing

warped dust
#

get that corny ass smile out

sullen fiber
#

how does it detect EOF

warped dust
#

it returns 0

sullen fiber
#

o

#

i would init an array

warped dust
#

⍒(&p.)(0β‰ ) &sc

sullen fiber
#

and make ur do function join into the array

warped dust
#

how does this not print every line

#

wtf is it doing

sullen fiber
#

dumpid

#

best

warped dust
#

make senseee

sullen fiber
#

ohh

#

ok so ur using != 0 "hello"

#

!= is a pervasing function

#

so its checking if all the chars are != 0

warped dust
#

..........................

sullen fiber
#

also ur order is wrong

#

its != 0

#

not 0!=

warped dust
#

im too stack based

#

okay HOW

sullen fiber
#

let me

#

this is gonna suck why must you stdin

warped dust
#

uiua is literally the only language where stdin is for no reason fuckin harder to handle than actual files

somber smelt
#

i just rebased my day 1 on apple swift template

#

they did some stuff better than me

#

organization wise

sullen fiber
#

are u sure it returns 0

#

cus for me it FAILS

warped dust
#

what the docs say

sullen fiber
#

KILL

#

ok

#

we will try catch

#

you love

warped dust
#

HORROR

#

WORST FUCKING LANGAUGE

#

i set two on the last command

sullen fiber
#

sorry i didnt know this part was so bad

warped dust
#

&fras "/dev/stdin" # FUCK YOU

sullen fiber
#

is that real

#

does that actually work

warped dust
#

on linux

sullen fiber
#

i did it

#

omfg

#

the loop is try catching the &sc and throwing away the error in place of a 0

#

and boxes the string or 0

#

joins

#

bleh

warped dust
#

hop ⍣&scβ‹…0

sullen fiber
#

wait

#

based

#

yea for comparing things that are arrays

#

use match

#

= will go thru arrays

#

it'll also go thru boxes

#

@warped dust someone in the discord said

#

&ru @\0 0

#

LOL

#

this is real

#

readuntil nulbyte fd0

warped dust
#

wtf

#

ITS REAL

#

FIRE

sullen fiber
#

are u using the formatter extension

#

or the pad

warped dust
#

uiua watch

#

lol

sullen fiber
#

no i mean like

#

to format ur code

warped dust
#

i save and it does the thing

sullen fiber
#

oh uiua watch is formatter?

warped dust
#

it runs but also formats

sullen fiber
#

does that fuck up ur cursor

warped dust
#

sometimes it goes offscreen

sullen fiber
#

F

warped dust
#

but

#

i just press b

#

back word

sullen fiber
#

real

warped dust
#

also doesnt fuck up undo history

#

vim cracked

#

vscode cries so hard if you edit a file externally

#

enough uiua for now i must beam

sullen fiber
#

real

#

wait i can just

#

binary search

#

in uiua

#

brain blast

proper totem
#

day one star one, requires the following c boilerplate blobcatcozystars

#include <stdio.h>

extern int star_one (void);
int main () {
    int result = star_one();
    printf("%i", result);
    return 0;
}
sullen fiber
#

LOL DAYUUM

proper totem
rain bloom
#

get ready besties

sullen fiber
#

yop

warped dust
#

yoop

#

oh no

#

oh GOD

#

WHY DID I CHOOSE UIUA

sullen fiber
#

its iceland island

warped dust
#

SO MUCH TO PARSE

sullen fiber
#

not real

#

oh wow

#

oh actually this isnt bad

#

sorry rini

fading mortar
#

this one seems easier than day 1

warped dust
#

idk i didnt read it yet i just got jumpscared by the amount of things to parse

#

imma get coffee

fading mortar
#

I could probably turn it into an object in a text editor

#

oh damn it is slightly more annoyinh

warped dust
#

The Elf explains that you've arrived at Snow Island and apologizes for the lack of snow.

#

fuckin climate change

somber smelt
#

what the fuck is this explanation

#

ok wait its actually not that bad okay

sullen fiber
#

20m will be writing a parser

#

love

warped dust
#

what if i did erlang today

sullen fiber
#

do

warped dust
#

yop sane

sullen fiber
#

abandon uiua tbh not sane enough

#

uiua guy said hes gonna add some ops to make string manip saner

warped dust
#

reall

sullen fiber
#

like substring mask

warped dust
#

erlang basically cheating

#

erl pattern matching is cracked

somber smelt
#

parsing this is easy tbh

sullen fiber
#

true in a normal language

warped dust
#

nvm kill erlang

#

why are only bitstrings cracked

rain bloom
#

how the fuck do you parse values sequentially from a string without having to splice into substrings constantly

somber smelt
#

did part 1

warped dust
#

erlang wtf is a head mismatch

fading mortar
#

I got it

#

nice

#

had 4 .split functions lol

rain bloom
#

its been half an hour and ive gotten nowhere

somber smelt
#

finished day 2

#

i can send my code if u want @rain bloom

fading mortar
#

insane fr

rain bloom
#

im not confused i dont know how the fuck to do it in rust

somber smelt
#

can u not split strings or smth??

rain bloom
#

pain

warped dust
#

oh its so easy

fading mortar
somber smelt
#

day 2 was so easy

#

just parsing

fading mortar
#

yeah

somber smelt
fading mortar
somber smelt
#

swift

fading mortar
#

oh nice

somber smelt
#

ill send in a bit i want to make timings use ms

solemn python
#

part 2 done

#

I'm certainly not going for shortest program award but it works and thats what counts

#

I don't care how cool my solution is I just like doing this tbh

rain bloom
#

i still cant figure out how to parse this stupid shit

solemn python
#

the power of regex

#

hehehehehhehe

rain bloom
#

i cant get my regex to work either

solemn python
#

as soon as I saw the problem I went to my terminal and cargo add regex'd lol

fading mortar
#

Hmm I can't figure out how to get this on one line

#

||Could probably use regex for all of part one||

solemn python
#

yeah its certainly possible

rain bloom
#

what the fuck is it doing??

solemn python
#

I used 2 regexes

#

one parses ID + picks, then I manually split by semicolon and run another regex

#

just easier for my brain

fading mortar
#

I have 4.splits() and 5.replace() just for part one lmao

solemn python
#

as I said, not the coolest but definitely functional

solemn python
#

but it looks cool to me so thats what matters

#

I love parsing data into rust structs

#

its so fun

#

and then you can dbg! and look at all the beautiful structs and numbers

somber smelt
#

mine is mostly splits

proper totem
#

||why did you all parse game ID out of it, just shove into an array and game ID is just idx + 1 (assuming zero based indexes)||

solemn python
#

idk who cares

#

if it works it works

somber smelt
#

||3 splits per game, 1 split per draw, then a split for each color that draw has||

solemn python
#

if you are codegolfing than sure but

warped dust
#

erl is killin me

sullen fiber
#

rini i did

proper totem
#

that came out more condescending than I meant it to, mostly just asking because i found it easier that way since I saw there were no gaps in the data xd

sullen fiber
#

i did day 1

somber smelt
#

||meh clarity my games are in structs||

sullen fiber
#

kill me

solemn python
#

making sense to me was more important to me at the time than being fancy

#

my code is very verbose

sullen fiber
#

did i cook

fading mortar
somber smelt
somber smelt
#

and splitting a lot works

fading mortar
#

yeah

solemn python
fading mortar
#

it is scary

solemn python
#

rituals are being performed

sullen fiber
#

its scary ur not wrong

proper totem
#

are ligatures just making it look scarier than it is or does it actually use weird unicode

solemn python
#

the ghosts of christmas past, present, and future are being summoned with your code

sullen fiber
#

no yea those are real

proper totem
#

fear

solemn python
#

how tf do you type that

sullen fiber
#

the formatter turns the function names into symbols

solemn python
#

oh

#

so you are cheating

#

I see

proper totem
#

oh that's not as bad then

solemn python
#

write them yourself coward

sullen fiber
#

thats PART of the LNAGEU

#

yea nah its not bad if anything it helps with readability

somber smelt
#

im happy with this improvement

solemn python
#

rate my very epic AoC cli

#

hm I should add color

warped dust
#

% erl -noshell -eval 'io:fwrite("~w", [pt1:solve(<<>>)]), halt().'
[]

#

banger

somber smelt
warped dust
#

you need to halt

#

or erlang just keeps running forever

sullen fiber
#

oh wow part 2 is so easy

solemn python
#

should I make an autosubmitter

#

is that possible without looking at html, I assume its a POST form

somber smelt
solemn python
#

but also I can't really test that so

sullen fiber
#

i literally had to calculate part 2 in order to do part 1

solemn python
#

i mean

#

thats one way to do it

#

I guess

warped dust
somber smelt
#

@delicate crane whatd u do

solemn python
#

its easier just to cut out the middleman though isn't it

warped dust
#

pt1.erl:4:9: a binary field without size is only allowed at the end of a binary pattern

sullen fiber
#

uh probably in a normal langauge it is

warped dust
#

nvm i hate erlang

sullen fiber
#

everything is a matrix in this lang tho

#

arrays matrices and tensors

warped dust
#

im doiing uiua

solemn python
sullen fiber
#

do u want my parser

warped dust
#

NOP

#

i WILL DOIT

sullen fiber
#

have fun

#

omg

solemn python
#

hey 5 is a cool number

#

multiple of 5

sullen fiber
#

remember dumpid is real

#

and your best friend

#

will log the whole stack

solemn python
#

4 is just that spot that isnt 1st 2nd or 3rd but just a failure

warped dust
#

rea

sullen fiber
#

can do inside functions

steady fog
#

i cant figure it out

#

guh

#

C# was a mistake

#

regret

#

i regret so much

somber smelt
#

i feel like there's a better way to do this but it wouldnt come to my head

steady fog
#

i dont even get the prompt

#

aufwefh

warped dust
#

LOl

steady fog
#

kill me

warped dust
#

@sullen fiber @<actual null byte>

#

works

somber smelt
steady fog
#

o

sullen fiber
#

WAIT

sullen fiber
#

DO NOT

#

WHY

#

STOP

#

actual null byte in your code fear

steady fog
#

whats the limit

warped dust
#

you love null byte

steady fog
#

oh

#

wait

#

ok

rain bloom
#

i give up
rust is dogshit to do aoc in

steady fog
#

i regret doing C#

#

without a proper project this is hell

#

The Elf would first like to know which games would have been possible if the bag contained only 12 red cubes, 13 green cubes, and 14 blue cubes?
@somber smelt are these the limits

rain bloom
#

i spent an hour and got absolutely fucking nowhere
regex doesnt work
cant find a single sequential reading lib for rust

solemn python
steady fog
#

oh

solemn python
#

just a shit ton of unwraps

somber smelt
#

swift is kinda nice to do this in

steady fog
#

if r > 12, drop game
if g > 13, drop game
if b > 14, drop game?

solemn python
#

b/c I don't have time for proper error handling

fading mortar
#

This is my parser:
||```ts
console.log(input.split("\n").map((game) => game.split(":")).map((x) => x.map((y) => y.replace(/\s/g, ""))).map(x => [+x[0].replace("Game", ""), x[1]]).map(x => [x[0], x[1].split(";")]).map(x => [x[0], x[1].map(y => y.split(","))]));

somber smelt
solemn python
steady fog
#

okay

solemn python
#

mine works fine, if I split the lines into easier to parse sections

somber smelt
#

split is your friend not ur enemy

solemn python
#

yeah

steady fog
#

i hate that foreach in c# doesnt have index

#

so i have to use standard ugly for

solemn python
#

initially I started writing the ultimate regexℒ️ trying to parse a single line in one go then realized I was stupid

#

loops are very cool things that don't translate well into regex

rain bloom
#

this literally should work

steady fog
#

this error is so useless

#

it doesnt even say what line

#

C# evil

sullen fiber
#

did u enable multiline mode

#

in rust regex

rain bloom
#

yes

solemn python
#

as I said, it becomes 10x easier if you just split the picks manually

#

then regex them

rain bloom
#

it's something to do with nested groups
and I have no clue how to fix it

somber smelt
#

regex is not worth it for aoc tbhhhh

sullen fiber
#

oh ur trying to do groups like that?

#

regex cant do that

steady fog
#

i only use regex for strings that are funny

solemn python
#

use harmony instead trolley

sullen fiber
#

unregular expressions

warped dust
#

i just deleted my lsp config instead of editing it

#

rate

solemn python
#

or wait not harmony

#

melody

#

right

sullen fiber
#

is that like a grammar builder and parser

solemn python
#

its a regex transpiler

#

that makes the syntax more verbose and easier to read

sullen fiber
#

oh bleh

solemn python
sullen fiber
#

hop on

#

make a peg grammer for each day

solemn python
#

I love it when rust crates literally just invent their own syntax through the dark magic of macros

#

its so funny

sullen fiber
#

lol real

#

i might try rust

#

for some days

warped dust
#

why is the lsp server not doing anyhting

delicate crane
steady fog
#

wtf

somber smelt
#

wtf did u cook..

steady fog
#

how did i get 21 as my total

somber smelt
#

mine was sub 100 lines

steady fog
#

how did

#

what

#

im getting bigger number than even possible

somber smelt
#

test data result should be 8

warped dust
#

IT KEEPS THROWING ERRORS

delicate crane
steady fog
#

@warped dust@warped dust@warped dust

delicate crane
#

I just need time to fix variable names and make typescript happy

steady fog
#

how am i getting 10

solemn python
#

71 lines including whitespace and function boundaries for p1

steady fog
#

i will feed rini to the flies