« first day (3617 days earlier)      last day (1523 days later) » 
00:00 - 08:0008:00 - 00:00

00:03
@Adám Nope, not until they have a user account here. Apparently the SO account on its own isn't enough to trigger, which is odd. I don't have their Chat Account info so I can't add them. Have them join here first, then I can extract their chat ID and add them that way
@ThomasWard Sorry, yeah, I know about that, but didn't notice I was looking at an SO account.
finger wags at you
00:21
hmm, for some reason the diamond mods only show the diamond, not their nick, if they only speak one line of text
meanwhile I see "Thomas ♦︎"
Apparently it's screen width issue again
GLORY UNTO CODE GOLF
FOR CODE GOLF IS IMPORTANT
in names without spaces like HyperNeutrino only a diamond shows but it seems like either the last word, all but the first word, or a certain number of words depending on width get chopped off
@UnrelatedString better? :P
YES IT IS
00:25
actually, I see "Wheat ♦︎" if I scroll up, so it's just wrapping for longer names for me
yeah screen width is a pain
I see full name, then as I shrink the window it becomes Thomas ♦︎, then Thoma ♦︎, down to T ♦︎
so that settles that it's width based
But I can't reproduce only single diamond being shown
00:26
all you need to know is the Diamonds are power :P :)
@Bubbler what browser
Chrome on Windows
I'm on Firefox on macOS 10.14
00:28
d?
That's some kind of inconsistent UI
Or is that an imperative verb?
SE chat doesn't even try to be responsive.
@Adám i see a nonstandard theme :P
wags finger at you again
as i said nonstandard theme which may be the reason the name is gone :P
looks like it floats right and Firefox pushes the name down "to the next line" if it won't fit
ahh
yeah that checks out
That's FF-specific then
00:34
and i guess chrome does the same thing but without splitting on spaces
actually safari 13 seems to have the same problem, just tried it
(yes there's an update pending, not sure why it didn't update automatically)
 
1 hour later…
02:01
@Adám maybe thats why the mobile version looks completely different
02:55
@Razetime no it looks completely different because trying to use the full version is a real pain on a small screen and the old version didn't seem to fit very well
03:10
5
Q: Golf me a polygonal loader

RazetimeCodidact post, CGCC Sandbox, Codidact Sandbox Given three positive integers as input, animate an ascii-art polygonal loading symbol on the screen. Intro You will be given three inputs, \$n\$, \$l\$, and \$d\$... \$n\$ (one of \$3\$, \$4\$, \$6\$, or \$8\$), is the number of sides of a polygon: ...

I'm not sure why I'm getting downvotes on this
04:02
CMQ: How do I get a truthy value when comparing the list type and iter type in python?
I tried list is iter and iter is list but they don't work
Oh wait iter isn't a type
oh lol
nvm then
@Lyxal please everyone ignore this message
04:19
That must be list == [*iter] in py3 (does it work in py2?)
or is it a totally different question
Probably a totally different question
I wanted a way to check if a type is iterable (i.e. list, range would return True while int, float, str, etc would return False)
(str isn't considered an iterable in this particular instance)
str is also iterable
then you have a problem
well what do you expect when implementing type cohesion not exactly implemented by python?
maybe one way to do it is to check if it can be consumed by iter, then it is not specifically a string
try: iter(x);return x is not str
except: return False
erm, that doesn't work either
I ended up just explicitly checking for range and list
04:30
Tomorrow I'll have to do days 20 and 23, I never finished them
@RedwolfPrograms that's a lot to do in one day
20, 23 and 25
Well, 8 hours with nothing to do should be enough. AoC isn't until 2300 in my time zone
Lel, AOC is 1600 for me
Hopefully today's won't be super difficult so I only have to do 3 instead of 4
This one better not be related to stupid crab games or my answer will just be step on the fricking thing
@RedwolfPrograms plot twist, that's the correct answer
04:42
Making python take implicit input if a list doesn't have enough items without creating a custom class is harder than you'd think
At least that's my current experience
Especially if the source the implicit input is taken from is unique to the list
Has anyone solved all aocs in brainfuck?
Presumably not
Probably not originally, but it'd be not-too-hard to go through a few transpilations to more and more tarpit-like languages until you go from a python or JS solution to BF
If it takes a long time for naive solutions in languages with standard data structures (e.g. python), then how much longer would things take in a language which only works with cells?
BF solutions would probably have to run for quite a while to get an answer
Unless someone makes a CPU that runs BF directly
04:46
or someone has access to a supercomputer
Besides, I doubt anyone would have enough patience to parse the various input formats supplied by AOC
Input formats which would have benefited from being placed in the sandbox
loool
Have the writers of the problems never heard of our list of things to avoid when writing challenges?
Was just mentioning that a few days ago, lol. Their standards must be a lot lower than ours.
10m
If there is another sea monster I will beat it to death with a whip
04:50
I mean, one can easily convert Brainfuck to ASM
Thus, most CPUs run brainfuck, one step removed.
Hmm yeah maybe it's possible with the asm2bf project
Predictions about today's suffering challenge?
@Lyxal reindeer
Yeah, but it'd still be faster if the hardware literally ran brainfuck
@RedwolfPrograms yeah good luck with that lol
04:52
I mean, only if you had the resources to build a chip on par with Intell or AMD, but poured those resources into optimising the limited subset of 8 instructions
But even then, the main optimization one would use is... more instructions.
Assuming the chip would be an 8 bit chip (As to handle the math), we'd be using a tiny fraction of possible instruction space
Another option would be to handle multiple instructions simultaneously with "Merged instructions"
"Given a list of seats, output all space cards where the fields aren't allergic to sea-monsters and fit together when rotated 82 degrees anti-clockwise. The answer is the index of the cup immediately left of the adapter with the most joltage multiplied by the three numbers that are found at random places in the weird input format."
There, I wrote a challenge for AOC
That'll probably be day 25
MOAR MATH PLZ
ur input iz big number. fin root of it in base a dquadrillion or sth and put it in box. haf fun
5
3
CMC: Given two numbers, a and b, Find the digital root of a in base b.
@RedwolfPrograms 05AB1E, 3 bytes
04:57
Probably not the right time to post a cmc
@RedwolfPrograms mathematica probably has a built-in for that
The right time to CMC is whenever. The beauty of cmcs
We've gone from competitively typing numbers to mocking AOC problems
04:59
I think this has progressed rather nicely
prediction: dynamic programming
and by prediction i mean uneducated yolo guess
Something that takes 69 years to run
10sec
GL&HF
> hex
fml
WHY HEX GRID
okay not too bad
05:01
A hex grid is just a square grid that's half shifted.
I swear it's athat stupid crab again
wait what counts as east of a hexagon?
Who's solving in hexagony
euler's identity is failing me
05:08
nice
dammit... i typod one character in part 1
Already!??!?!!?!?!?!?!?!?!
i practiced hex grids xd
...oh
because i fucking used 8 directions
lol f
dammit i lost to beta by 1 second
if i didn't make that typo i could've gotten easily like 15/3 or so
05:09
what is this input format?/1
it's just annoying xddd it doesn't make the problem any harder
floating point errors and a complex type that can't be rounded itself ftw
hex grids are actually extremely easy to express in complex numbers but i can't really give a hint other than just the answer
i started so late
hex grids are fake square grids btw
complex numbers are shit
input format is ezpz its litearlly like a9 char regex
05:14
Imagine using a language that supports Complex numbers amirite
goddamnit
game of life again ugh
xd
so my prediction was not at all right :P
i am wishing i had maybe implemented an actual grid now
my prediction was wrong as well
@HyperNeutrino it does for me
sorry i mean like. conceptually
it's just annoying format especially for some languages
05:16
I have no idea why my answer is wrong lol
It fails the example but my code is practically impossible to debug
In a second
i was about to fix my complex based solution but then i realized that each tick was quadratic in grid size so...
Oh, it's because I;m dumb
I'm just incrementing and decrementing them over and over again
your grid encoding doesn't work
05:20
Yeah, I feel dumb now :p
Still not right :/
Did you mean the encoding itself wouldn't work, or just my stupid implementation?
the encoding itself
for sanity check, NE SE W should reset to 0
05:22
Oh hey, I don;t need to work with integers
Got it!
ehh 500/350
good enough for 5 min late start
More cellular automata?
that's not bad. pretty good actually for 5m
@RedwolfPrograms smh
ew but ok
if you don't use integer grid ur just bad
05:25
wait what if not int grid then how
Wait, so is the result of p1 the initial state of the cells?
@RedwolfPrograms assuming you're still on part 1, you'll wish you did on part 2
@HyperNeutrino ±.5 is ew
@RedwolfPrograms yes.
@UnrelatedString wrong but ok
i used a 2D array in js for p1 and p2
arr[[i,j]]
my point exactly
im so big brain ngl
05:26
not really... if you have any neighbor list and arbitrary access mechanism p2 is the same logic for state transition
i'm completely scrapping my p1 solution because floating point complex numbers are not very good for ceullular automata
@UnrelatedString wrong
i could literally trivially switch to ±.5
since guess what
floats can represent .5 exactly
js moment?
first of all why's that and second of all if you're using a real hex grid with irrationals then that's gonna not work
oh like that
05:27
well... js dont have 2d array
all arrays/objs have string keys
and that's the secret
2d array wouldnt work with negative indices anyway
and a dict would work with float tuples fine of course. so no problem no matter what language
wait what does your array store
also does a[2][3] not exist like
js doesn't have 2d arrays ?? what
I mean, it has a[i][j]
But I don't think it has a[i,j]
oh it has jagged arrays but not multidim yea
Keep in mind, indexing nil is an error
05:30
@HyperNeutrino a['2,3'] === a[[2,3]]
huh okay
but what does a[[i,j]] mean in your program
Oh my
it is coords
what else
oh js doesn't have sets does it
Yeah, [[i,j]]just converts to ["i,j"]
05:31
it does
I didn't know that existed, that's great.
im just lazy
a[[i,j]] just indicates whether something is black or not?
^^ oh nice
you can't index into sets so i don't see why i would use those
that makes sense tho
eh. i suppose
but like
05:31
or well im just lazy is what it is
set insertion, membership, and deletion is O(1)
just like hashmaps so.
An issue arises when one uses that format with strings
My p2 is going to take like 10m hope it;s correct
As l[["a,b", "c"]] is equivilent entirely to l[["a","b","c"]]
05:33
oh true. wait so does js even have arrays or are they secretly just hashmaps or wat
Secretly Hashmaps.
Secretly Hashmaps of strings, to make it worse.
._.
i hate this so much
nvm it's getting quadratically slower after each iteration
My p2 is too slow
yikes what how
l = []
l[1] = "hi"
console.log(l["1"]) // hi
05:34
I;m storing a list of alive cells
Actually, a hashmap with alive/dead
(arrays are just Objects with more information stored in them, they're less efficient than just using an object)
does each iteration give the right ans tho
No idea
I'm going to try a more efficient approach since this one might take a few heat deaths of the universe
Ah yes, the good ol' fashioned "Works theoretically"
ok now I can finally use th input yay
05:38
Finished 182/938
The slowdown is constant this time!
And I'm not seeing how one can write a slow part 2 algorithm. I spent little effort optimizing mine and it completed in several seconds.
i can think of a fast-ish way and a slightly slower approach but quadratic speed difference sounds like a bug probably
even if you scan the entire possible space it's linear slowdown i think. but i could be wrong
You'd be amazed how inefficiently I can code if I set my mind to it 🕶
05:44
Mine gets way slower with more active cells
my code has decided that the example collapses to the point of having exactly two black tiles forever
@HyperNeutrino due to hidden classes it does have arrays. spec wise theyre objects
...I just realized finding the unique items in an array of arrays does nothing at all and I;m iterating through tens of thousands of repeated items
wait not that was my real input
oh okay. js is confusing (to me) xd
05:45
@UnrelatedString maybe it does way after 100 iterations
it just completely died on the example
@RedwolfPrograms why th
How'd I guess 53 would be wrong...
75/1038
Frick, I didn't read the GoL rule correctly
twice
or three times
...my hex grid is completely wrong judginf rom that it thinks the example starts with 17 black
05:48
How big were y'all's answers? Is 53 reasonable? 530? 5300?
mine was 4k-5k
Mine is between 3k and 4k
Oh, so 53 is probably wrong
i can't get top 10
pain
f
i'm just proud i got #25 yesterday lmao
05:50
ey nice
I was relatively fast on part 1 because I knew one of the hex grid tricks
my total global score is 90 now
but truly didn't expect a hex GoL
05:52
yeah i knew about how to encode hex grids with the +2 thing cuz uh
but that didn't stop me from making something unsalvageably dumb
i practiced a hex grid problem from a previous AOC when building my template lmfao
+2 thing? where the hell does a +2 come in
east/west is +/-2, 0, and then the other four are +/-1 +/-1
oh like that
...of course
I really need to start actually using paper
05:53
yeah. idk if it's actually the best but it seems fine
and I still got the algorithm right pretty early, but didn't realize the GoL rule was wrong until I re-re-reread the instructions, losing 20 or so minutes
and my grid still starts with the wrong number
f
Trivia: in Factor, f is the only falsy object, and it has insanely many overloads for empty containers
ngn
ngn
part2 yay! :) success = brutally inefficient coding + patience
05:56
In funky2, the only falsey values are nil and 0.
true and false don't exist, which is probably a mistake.
Sanity check: The rule can be written as black_tiles_adjacent == 2 || is_black_tile && black_tiles_adjacent == 1, right?
WRONG
okay i finally stopped not actually moving west at all for the west ones
wait, black_tiles_adjacent is what?
sum of surrounding six?
Wait, really? (That's for if it should become black, not if it switches) (yes to your question)
05:58
I'm still confused with the rule apparently
I think it's right then
yeah it took 30 seconds on a piece of paper to figure out why my old encoding doesn't work at all
I tend to sum all neighbors plus self when implementing any kind of GoL, so I usually get something different from others
same
this is the rare exception because i already had the directions somewhere
Can someone tell me if they see a problem with this?
Can't figure out why it's wrong
It seems to keep giving me less alive cells then there should be
Wait
I just noticed one of the function calls said there were seven adjacent active cells and...oh
duh
06:06
Was it counting itself?
I'm counting the cell if it's alive in the list of alive adjacent ones lol
It looks like it's not the right way to count neighbors in hex
wait. is this happening on an infinite grid?
sure, why not
06:06
aaaa
so you need to expand every turn like you did in previous GoL tasks
Okay, now it's slightly less incorrect
ngn
ngn
@Razetime it's only 100 steps, so 300x300 is as good as infinite
300x300 is good for correctness, but probably too large for speed
Hexagonal grids have no gliders, that i could find.
Wait, there's a 5 step glider
Which means a tile can only stray ~100/5 tiles away from start
06:11
Anyone see any other issues with my code?
I replaced the test function with (o, n) => (n - o) == 2 || o && (n - o) == 1, which fixes the counting itself problem
Still wayyyy to low though
I stupid
Mistyped an array index
ngn
ngn
@RedwolfPrograms are you sure that formula gives you only 6 neighbours?
I think, as long as my coordinate system thing works how I think
Probably it is counting self?
does AOC usually have this many games of life
I already corrected for that
ngn
ngn
06:15
so, what should [0,0]'s neighbours be? [[1,0],[-1,0],[0.5,0.5],[-0.5,0.5],[0.5,-0.5],[-0.5,-0.5]]?
No, [[1,0],[-1,0],[0.5,1],[-0.5,1],[0.5,-1],[-0.5,-1]]
    [x[0] + 1, x[1]], [x[1] - 1, x[1]],
    [x[0] + 0.5, x[1] - 1], [x[0] - 0.5, x[1] - 1],
    [x[0] + 0.5, x[1] + 1], [x[0] - 0.5, x[1] + 1]
(Ignore the mistyped index on that first line, fixed it already)
And the code is still wrong?
Wait, code was casting to string on the .s(","). Fixed, now it's working for test case
06:18
haha I got 38*69*
(I got to 8th place in CGCC leaderboard, just because Redwolf is 3 stars behind)
lol
Not for long, although it's not like it'll move me up very far
YES!
It's a competition between you and me. I don't think either of us will catch pppery
ngn
ngn
@RedwolfPrograms ah, i see. and [0,0] is a neighbour of itself?
(and you might not get enough points to get 8th place back. The golds are slowly filling up)
06:21
Another victory limp to the finish line sort of victory not a waste of time accidental win reason to switch to Python
Well, JS and Python are almost equally usable (not considering libs, which you can solve by creating your own lib for speedcoding anyway)
@HyperNeutrino please do leak the secret imaginary number tech
At least python protects you from spending 40 minutes debugging type conversion issues
You don't need complex numbers per se, you can do just well with number pairs
I finished it, just want to try using imaginary numbers
06:27
Plus python has imaginary numbers and arbitrary precision ints by default
complex numbers are just a convenience
A pretty nice one for fast programming
and more of a convenience when you have a sense of orientation than when you're doing something like this
This jay foad guy is really fast with apl
i ended up doing a shit ton of roundtripping between complex and integer pairs and it took like 5 minutes to iron out the kinks lmao
06:29
@Razetime That jay foad guy is on APL Wiki
oh wow
no wonder lol
@UnrelatedString so you reworked it multiple times to use both?
And APL can indeed save a lot of time when you know how to solve it
yep, he's 70th global
(in other words, without enough APL problem solving experience, it's a pain)
@Razetime the which
06:33
@Bubbler story of my life this year
it's literally just E = 2, W = -2, and then everything else is +/-1 +/-i
which is why I advocate the APL bounty, especially 200+s and solving more complex problems
standard shifted rect grid and then use complex cuz OP
1 hour ago, by HyperNeutrino
hex grids are actually extremely easy to express in complex numbers but i can't really give a hint other than just the answer
@Bubbler i am trying lol
> He also developed a technique for transposing Boolean matrices with multiple-of-8 dimensions
what
you do E=2, W=-2, NE=1+i, NW= -1+i, SE=1-i, SW= -1-i
lol
06:37
@Razetime probably some clever bitwise trick that's more efficient than general transposition
@Razetime It's just a matrix with 8n rows and 8m cols
ah right
07:38
1
Q: Why do moderators decline "no longer needed" flags on chatty comments?

Cody GrayI primarily land on Code Golf by visiting links to questions from the Hot Network Questions roster. When I see comments on answers like: Good observation! or Wow, impressive! I tend to flag them as "no longer needed". This is in keeping with my understanding of how comments should work across...

00:00 - 08:0008:00 - 00:00

« first day (3617 days earlier)      last day (1523 days later) »