« first day (3607 days earlier)      last day (1533 days later) » 

03:37
which basic dialect is good for playing music?
1
A: Sandbox for Proposed Challenges

ScottA Snake, A Camel And A Kebab. As many of you will know, almost every programming language has a standard casing system; unfortunately, we have not been able to agree on a singular system to use and now must frequently switch between camelCase, snake_case and kebab-case. Now I know what you're thi...

Can someone char something in the sandbox room? I'm testing something.
04:42
@RedwolfPrograms Do you mean "star"?
No, meant "chat" :p
Someone already did, though
OK
Fixing typos is difficult
Eight minutes to AoC
now at around 5
0
A: Sandbox for Proposed Challenges

RazetimeSimon says "Make me a game" code-golf graphical-output game Forked from this closed question. Create a "Simon says" game. Take an input \$n\$, for number of levels, and \$k\$, for number of buttons and do the following: Create a square area for the buttons.(at least 100x100 pixels in size.) Div...

04:57
Around two minutes
1.5
1
we didnt forget. dw
i forgot
dw
nice
welocme bcak!
04:59
Can anyone identify the islands depicted in the ASCII art (other than the big white one at the top)?
I'm here too
85 part1
:(
bah screw rank
all my homies solve for completion
that's funny, my part 2 answer came out wrong on my real input but it actually works on the example
replaced my dict with an actual array and surprise surprise it's too slow to tell me if that magically fixes something lol
05:20
499/200
I would have done better on part 1 except I made an off-by-one error
My solution, for both parts, works by interpreting lines that don't set the bitmask as python code.
i spent a bit too long debugging second part cuz i didn't read the spec clearly enough
I got 88 on part 1 with regex instead
but cannot for the life of me figure out why my part 2 is incorrect
05:22
could've gotten maybe like 6th with 2 :/
I got top 100 in p1 for the first time
My p2 is taking forever to run
309 ehhhh
Part 2 shouldn't take too long. Mine was practically instantaneous
@pppery couldve eval'd setting the mask too i think
same here
05:24
@pppery mine is if you ignore the fact that apparently it doesn't work
@ASCII-only how?
oh wait
It's actually somewhat surprising how fast it is, given it has four nested loops
mask isn't quoted huh... so yea its probs easier not evaling
05:25
I am an idiot
10/10
i wrote a generator function for part 2
okay so I thought the problem was misuse of Python iterators but it's still wrong
Oh no, I'm counting 3.5 billion items by accident
not sure if anyone else did or im just dumb
@RedwolfPrograms lel same here. 4.2 billion items so i used a for...in... loop instead cuz it's sparse
@ASCII-only smart
05:27
Why is a generator useful?
X
with a generator, X = two recursive calls
you can yield from and all that
That's clever.
in js, yield*. embarrasingly, had to look that up, heh
05:28
I just wrapped itertools.combinations on a set of floating bits
i
damn that's smart
meanwhile I still am inexplicably getting an incorrect answer on my input but a correct answer on the example
converting to/from wrong base?
or not baseconv-ing at all?
Dang eval is so much slower than I thought
the example didn't catch the first issue because there's only one assignment per mask so it's not an issue that the mask gets consumed lol
05:29
The only base conversion is from binary when parsing bitmasks, right?
@RedwolfPrograms it shouldn't be
er... i may or may not be dumb and convert addresses to binary instead
I use python bitwise ops
same
construct a list of masks to XOR with on the mask assignment
I keep messing up
no, I didn't use XOR at all
interesting how each of us has a different approach.
I think I ended up reimplementing XOR using AND, OR, and bitwise inversion
05:31
neat
I just tried something incredibly dumb and now I'm on the 5 minute cooldown
Not the rigth answer :(
I wonder why this is so hard.
I only got part one wrong once, after a bug in string parsing caused me to drop the first bit of every mask. I got part 2 right first try.
i got part 1 wrong once, part 2 wrong twice
wait this isn't xor is it
oops
05:34
because 1 overwrites with 1...
*didnt get part 1 wrong. typo
@ASCII-only but ...
hilariously, i accidentally submitted the code the second time for part 2, not the number
normal or
I can't read
05:35
so i used the time to check my answer on example and caught a bug
narrowly avoiding 5 minute timeout
and now I'm getting the example case wrong because or violates my assumptions about xor
Oh, and I have exactly 5454 rep.
Day       Time  Rank  Score       Time  Rank  Score
 14   00:06:50    88     13   00:38:27  1067      0
damn im tying with hyper on private leaderboard now
nice
finally got my rank 1 tho which is very epic
4
05:39
indeed
wait u got rank 1
>:( maybe i should use python
possibly
python is very nice for AOC cuz
Arrrrrggh operator precedence
infinite integer precision BTW
also i feel like you'd save time not writing golfed code but of course that's my opinion, whatever works for you is good
@HyperNeutrino js has arbitrary precision integers too so....
05:46
oh really i thought it broke beyond like 1 quadrillion
or is that float
that's floats
My solution to p2 contained both 42 and 69, so I knew it was correct
1n is biginteger
i tihnk js integers are floats by default
but there's also BigIntegers
aka BigInt('1111111111')
05:47
Day       Time  Rank  Score       Time  Rank  Score
 14   00:06:19    59     42   00:46:21  1543      0
lol
>:( no fair your part 1 was faster
I screwed up so bad with operator precedence
i'm considering adding some sort of mask substitution to my template
once again my program is slowed down by the shear size of the input.
i think i have a way to shortcut today's problem with the template although i didn't use it
05:49
@RedwolfPrograms and i thought mine was extreme
First top 100, though!
@Lyxal what lang are you even using
an open letter to python: let me use bigger numbers with lists.
wait lyxal how did you do yours
did you have slow runtime?
@Lyxal why can't you
05:52
@Lyxal what
oh just
use a dict bro
did you... use an actual list for your memory...?
or use js like a sane person
@HyperNeutrino i tried extending my lists using [0] * (index - len(list) + 1)
@UnrelatedString no.
I used a custom list class i made
@UnrelatedString i did :D
05:52
uh
just use a dict lol
@Lyxal just... use a dict...
dict no work
it's inherently sparse
gives wrong answer
...why not
05:53
0/10
wait how
send
@Lyxal maybe it's not the problem lol
are you doing sum(d) instead of sum(d.values())
05:53
@HyperNeutrino no
@UnrelatedString so are js sparse arrays :p
it gives right for test sample
@ASCII-only :p
but not for big
@Lyxal dude same here, my problem was I thought I could just XOR after substituting floating bits
05:54
oh wait
AOC bugged
it was right
and also I used raw iterators but that's a different problem
okay wth happened?
i submit answer
it say: "you need to wait"
im like "ugh fine"
well according to the private leaderboard you have finished
but then i check aoc problem page
and it be saying "nah bro, you all good"
05:55
guys i broke aoc
ive worked my magic again
nice
lyxal how did you do it with dicts, i want to see what the problem is
my magic is breaking things
@HyperNeutrino there isnt a problem
aoc is the problem
it worked lol
also according to the private leaderboard you did not finish yesterday
maybe i'm not one to talk with like 3 part 2s unfinished from last year but yeah
@UnrelatedString that's because I didn't
When I get to the resort, I'm gonna try and get them to give me a 1 coin discount if I give them a netherite ingot
06:26
@Lyxal tip: if you're doing for index, y in enumerate(b) and the only thing you do with index is a[index], consider doing for x, y in zip(a, b) instead
I seriously regret missing day 13
because Factor has a built-in for chinese remainder
LOL
dude i should learn mathematica so builtin for everything
ngn
ngn
06:41
is there anything better than bruteforce for today's part2?
i doubt it
I don't think so
and bruteforce seems fast enough (as long as you use hashtables)
ngn
ngn
@Bubbler all my previous solutions take <1s, this one is 30s. i don't like this :)
takes 300ms for me in js
ngn
ngn
@ASCII-only do you publish your solutions?
anyway, cleared day 13 and 14, and now I'm back to rank 9 on CGCC leaderboard :P
ngn
ngn
@ASCII-only thanks
@Bubbler for me the leaderboard is an indicator of how early i wake up, not how well i solve problems :)
@ngn For me it's an indicator of how much I can use my PC at 2PM :)
ngn
ngn
@ASCII-only what is _?
oh oops, that's the input split by newlines
06:59
@ngn how are you doing it? for me mine runs near instantly (using python) and it's just the straightforward bruteforce
Factor's library is somehow math-heavy in weird places, e.g. gcd actually runs extended GCD and returns a modular inverse along with the GCD
ngn
ngn
@HyperNeutrino bruteforce too - at every step i generate a list of indices to update. the memory is represented as a dictionary. the machine i'm using right now is old and slow though.
huh, that's exactly how i did it. the machine might explain it, though 30s is still a bit slow but it might be why
30 seconds... that'd be like 20 year old hardware tho
depending on impl i guess
ngn
ngn
@ASCII-only yeah, i'm using a language of my own :) which ironically aims at speed
07:06
my input sets 78912 dictionary values so it's probably around 100k max which is why i was wondering how it was 30s but meh
ngn
ngn
@ASCII-only why do you have 2 solutions per part? for part1 i get an error at match[2] and mask.zip (running with nodejs)
ah
oh i have my own userscript
that imports a library
for day 1 (and recent days) i haven't been using the library, in part 1 at least
is there a faster algorithm for part 2?
ngn
ngn
@ASCII-only the match[2] error is my fault - i forgot to rm the trailing '\n' from the input
35 mins ago, by ngn
is there anything better than bruteforce for today's part2?
@ASCII-only it worked! part2 produces the correct answer in 7.9s here
07:22
oof. kinda slow
In other news: I've finally got fed up with Rust's but-what-if-it-isn't-ascii and used my first unsafe block ever :P
maybe it's a 32 bit systme
ngn
ngn
@ASCII-only 64bit but old - not much cache, no avx
my brute force gives me WS FULL :(
ngn
ngn
@Razetime use export MAXWS=2G (or as much as you can afford). the default is too low.
07:25
oh
Fair warning: Don't try (2*36)⍴0 at home
I can imagine that would go poorly
i don't know apl but i presume that's [0, 0, ..., 0] 2^36 times?
hm. yeah sounds like some things might go wrong :P
07:30
being some kind of reshape-right-to-dimensions-described-by-left
I doubt using / is any better
smh just call it "rrtddbl"
this thing'll definitely run by tomorrow
aw c'mon, it's just a quarter GB
...it's really funny how displays as this tiny little ⍴ outside of monospace but normal rho is just ρρ
07:31
thankfully "by tomorrow" is a broad definition
... half GB if you use 8-byte cells
⍴⍵⍴
that's interesting, the apl rho actually looks slightly different from the greek rho in monospaceas well
it uses the math symbol rho i think
not the greek alphabet rho
07:33
I did try running it on TIO, and it refuses to run until I say MAXWS=256G, which then crashes badly
@Razetime I know a lot of APL characters have their own Unicode codepoints
Ok I may have an idea
which might be even more inefficient
ngn
ngn
@Razetime me too
maybe you could somehow model the sparse array with an array of addresses and an array of values? not necessarily two arrays but yeah
key on repeated indices
sum all the things that occur once
07:36
hashtable > some kind of list dict
@UnrelatedString I guess that's the way to go in APL
if apl has hash maps then... definitely use those
ngn
ngn
@ASCII-only list dicts can go a long way before hashtables are more efficient
for 1. not reinventing the wheel and 2. sub-linear lookup
APL doesn't have hashtables per se, but Dyalog can set certain arrays as "hashed", keeping value-index pairs
I think this should work well enough
07:38
that might help then
this was way easier in ruby
@Razetime That's wrong
it must be "sum all the last-appearing values"
yeah
not sure how to use ⌸ tho
(actually didn't think of Key, and I just got how it would work too)
nice
07:43
Basically you construct two vectors, one for memory addresses and one for values
then values {something}⌸ keys should do the job
ok, got the keys and vals separately
ngn
ngn
can we use inclusion-exclusion to solve this efficiently?
a mask with n X-s contributes value*2^n to the result, but we have to compensate for previous values intersecting with it
Probably yes, at least it should reduce the number of items from "all individual memory addresses" to "all non-intersecting memory address blocks"
08:00
Wait y'all used regex/string splitting for today's aoc?
I just used exec
exec is good for languages that support assignment that way
the thing about using exec is you can't just intercept the value/array for masking
08:27
@UnrelatedString not unless you make a custom class
that is true
 
2 hours later…
ngn
ngn
10:10
@Bubbler success! :) i'll comment and post it a bit later
10:38
@RedwolfPrograms, you say on your website "At RedwolfPrograms, we work to [do stuff described on the website]". Who else is there that constitutes the usage of we?
And does that mean more than one person uses your cgcc account?
These are serious questions I need serious answers to.
Well, I don't really need them, I would greatly appreciate them
Is Redwolf Programs a hivemind?
pluralus maiesticus?
ngn
ngn
10:57
1.6s (bruteforce was ~30s)
11:23
Awesome
 
2 hours later…
13:30
@Lyxal The website came before the account, not the other way around. My friends and I were going to start a game development company called Redwolf Programs, but we ended up going to different high schools.
14:20
What the heck, I just remembered I had a dream that minecraft commands and CSS got merged, and I applied display: none to a creeper.
 
4 hours later…
18:47
0
A: Sandbox for Proposed Challenges

vrintlePossible binaries number code-golf base-conversion permutations This challenge is inspired by the AoC 2020, Day 14 - Part II, created by Eric Wastl and his team, which asks to output the possible binary values from a bitmask. Let's say we've a bitmask like "10X0X0", then we've to find the possib...


« first day (3607 days earlier)      last day (1533 days later) »