« first day (3611 days earlier)      last day (1215 days later) » 

12:21 AM
@Neil If it gets starred in the chat room made specifically for it, that's on Meta Stack Exchange, so you won't get it on Code Golf.
Quick question: Are popularity challenges frowned upon like code trolling questions, or are they still supported, but only if they meet certain criteria?
 
@user They are still supported, but very hard to get right.
 
My hats are so cursed, I have 11 hats including the one for getting 11 hats
Tied for 16th overall in the hat game too, pog
 
12:38 AM
@user yeah I suspected as much
@RedwolfPrograms ...what do you do with those 31 stack exchange accounts?
 
Make a comment once and forget I made the account
 
figures... I'm too lazy to make an account just to comment
 
I also have like 30 more hidden
 
actually I was too lazy to make an account on music.se to say "this tune is in the key of E because it's a transposition of Mozart's Marriage of Figaro from D to E" (someone else got there eventually)
no wait, maybe Don Giovanni
no I was right first time I think
 
1:04 AM
11th place!
 
11th place with 11 hats?
 
 
4 hours later…
4:50 AM
10m to AoC!
8
6
4
 
3
2
 
Finally reminded myself to set up my boilerplate in time
 
1
 
Good luck, everyone!
2
 
thanks, i'll need it :c
 
4:59 AM
Please dont let it involve multidimenisons
 
Go!
 
easy
its a parser
oh
no precedence
sad
 
dah where's a good infix to postfix converter when you need one
smh
 
backwards apl
 
thats what i was thinking
ugh it feels like im writing Vyxal's parser all over again
 
5:11 AM
ono did an oopsie. p1 rank 191
precedence part 2 ew
 
105/72
wow today was bad :/
i don't know if writing a parser template is good
i wonder if it would've been easier to try modgrammar
i feel like my part 1 was unnecessarily stupid
 
lel rank 96
i did some random change and it magically worked
i changed like 2 lines literally
@HyperNeutrino you should see mine
 
Still on p1 :/
 
my part 2 was cheese
like actually so troll
 
@HyperNeutrino same
i had a suspicion p2 was gonna be precedence but too lazy to handle that
 
5:15 AM
ah
i wish i had that foresight
i completely memed it with python though
 
...
cheating
 
i can explain if u'd like but idk if spoilers are bad
 
you probs did some cursed operator overload
 
fucking hell
 
5:16 AM
xddddd
 
read it if you're brave enough
 
that's how i still got 72 after a bad p1
 
also remember to bring a puke bag in
im surprised i got top 100 for p2 tbh
 
after seeing that i have elected to not read it
 
considering how badly i choked p1
 
5:17 AM
i'm really inexperienced with parsers so i kinda just threw stuff at it
 
@HyperNeutrino it's actually not amazingly bad, i'm kinda proud of myself
 
surprised it even worked
@ASCII-only it's golfed and it's js tho
 
;_; im sorry
im temporarily 3rd on leaderboard until someone else finishes today
 
wait i am
so stupid
 
why
tbh
couldve used haskell
 
5:20 AM
my part 2 sol could be used in part 1
 
lel
 
if i overloaded - to * and then just eval
 
yes.
 
aahhhhhh i literally was thinking of this
but for whatever reason i forgot there was smth that would make this work
 
i was kinda assuming thats what u did for part 1 tbh
 
5:21 AM
i thikn i just got too caught up with how to most quickly code a parser
nah if i did that i would've gotten a much better ranking lmao
 
look
at least ur faster than me
 
gonna derank reeeee
 
i submitted a wrong answer for part 1
 
oh nvm i'm still 15th
but by a larger margin to 14th now
 
unfortunate
 
5:22 AM
when you have to look up the shunting yard algorithm on wikipedia but only drop 1 place from star 1 to star 2
Day       Time  Rank  Score       Time  Rank  Score
 18   00:13:56   315      0   00:22:05   316      0
 
smh my head
ok so
im big dumb and have shunting yard memorized
from having to implement it
 
literally every
single
time
 
never even heard of it lmao
 
every time i make a new lang which is like once every 30 mins
 
5:23 AM
my parsers are always terrible
 
i have never taken a computer science class in my life because i'm not in college and my local high schools suck
 
every other AOC is just me regretting being dumb
 
correction, i have taken a """computer science""" class
 
i didnt take a cs course for langdev so...
 
but ap computer science doesn't count
 
5:24 AM
thats not an excuse guys
shunting yard is one of literally two ways to do operators for recursive descent parsing. the other being pratt
 
also never heard of that
probably why neither of my languages with sophisticated parsing actually work properly
 
its the algo used in crafting interpreters
by munificent aka bob nystrom
 
Got both first try again!
Day       Time  Rank  Score       Time  Rank  Score
 18   00:20:36   762      0   00:25:25   477      0
 
Not that good time wise, but I'm getting better at debugging
 
5:26 AM
@RedwolfPrograms same lmao
 
time wise i did absolutely horrendously
 
i'm genuinely shocked my code didn't need to be debugged
 
i had to debug mine... sad times
 
I had so many infinite loops, and if you're wondering how JS handles those...
 
close the tab and reopen
trivial fix
 
5:27 AM
Yeah, still super annoying though
Not just ^C and done
 
well it did need to be debugged but it gave me a right answer once it stopped crashing
 
you don't understand how many times i've had to do that
 
I definitely understand :p
 
^W then Shift-^T
 
In Chrome I have to double click the × button, Ctrl+W doesn't exit an infinite loop (probably due to JIT compiling)
 
5:28 AM
ok fair, i have to do that too
cuz js handles the keyboard events. probably.
 
Oh yeah, it has to try to wait for window.onbeforeunload
 
978/611
 
I'm just amazed my theory was almost exactly correct about the calendar art/ordering
 
For part 2 I used the Python interpreter with a custom int subclass, but I wasn't that clever for part 1 and wrote a very messy custom parser.
 
what theory
 
5:31 AM
SAME
i am in Pain tm
 
on the other hand i wrote a very messy custom parser in js
and changed 2 lines for part 2. even tho i didnt prepare for it
 
It took me 23 minutes to do part 1 and then only 6 to do part 2 for that reason.
 
Day       Time  Rank  Score       Time  Rank  Score
 18   00:11:33   191      0   00:13:43    96      5
im honestly kinda impressed how fast i did p2
 
@ASCII-only This theory (5 days ago or so)
I was wrong about why we turned around, but not about the actual turning around and looping back
Dec 12 at 5:22, by Redwolf Programs
There are exactly enough gaps in the ASCII art for us to double back and return to the north pole, then to the equator. We run back to get something.
 
I also failed to assume that all numbers were only one digit in writing that custom parser.
 
5:36 AM
I was halfway through writing a reverse polish notation parser when I realized it was human math in the input
 
they are?
oh come on. i wish i noticed that
 
Same here
 
lmao same
 
not that it really matters, cuz it didn't lose me much time to account for that given that i used the wrong approach anyway...
 
I used regexes
 
5:37 AM
i could have just removed spaces
but it didn't take me that long to do the regex i guess
 
@RedwolfPrograms rpn doesn't need a parser bro
@pppery for me it didn't matter
 
m=['(',...s.match(/[()+*]|\d+/g),')'];
like the brainlet i am
 
Frick
6
my code gives correct answer for all test cases in p2
but the final answer is wrong
 
5:42 AM
rip
 
What do you get with 8 * (2 * 3 * 3 * 5 * 3 + 5) * 8 * (7 + (7 * 7 + 3 + 8) * 7 * 2) * ((3 + 3) * 7 + 9 + 4 + (2 + 7 + 2 + 6 * 7 * 9) * (9 * 3 * 5 + 9 + 7)) + 2?
I get 318457470320640
 
(What are we looking at?)
 
Arithmetic evaluator where + has higher precedence than *
 
Hol up, I can just re-wire Funky2 to do that :P
 
5:49 AM
I even made my code print every step and I can't find anything wrong
 
Swapping their precedence gives me 318457470320640
 
Looks right
 
As opposed to 876453916802 using standard associativity.
 
So why my code is wrong.........
 
Can I see your code?
 
5:53 AM
-1
Q: how to use GCLang Xchek tool

JulyI want to use Xchek tool but I can't find any tutorial. How can I turn on the Xchek interface? http://www.cs.toronto.edu/~arie/xchek/ This is the guideline of Xchek, but I couldn't find where is the Xchek interface is.

 
Unfortunately it's in Factor
but it's basically repeating regexp replace in three levels
Let me translate into pseudocode
( ( ( replace /\d+ \+ \d+/ into the sum of two numbers ) repeat until converges
replace /(<?!\+ )\d+ \* \d+(?! \+)/ into the product of two numbers ) repeat until converges
replace /\(\d+\)/ into the number without parens ) repeat until converges
This is the whole algorithm for evaluating single expression
Okay, changed my regexes and it finally gave a different answer
which was accepted
960/2152
Maybe I should try out the parser library that comes with Factor
 
Who
6:18 AM
doing some proggraming for game mods
 
6:38 AM
@Who nice
I need some help from a person that know userscripts here: gist.github.com/razetime/053c80f62b8b820b69721b18cdfc27eb
 
Hmm, probably I should have used EBNF parser library in the first place
so easy to transition from part 1 to part 2
 
wait this is just ⍎⌽?
 
For part 1, yes (apart from '\*'⎕R'×')
 
I forgot about this while writing the userscript dammit
 
part 2 isn't like that though
 
Who
6:44 AM
@Razetime gonna explain the way the puzzle works, then program it.
 
cool, I'm solving AOC rn
 
also the numbers go pretty big
 
@Bubbler hmm seems like it's not working
oh nevermind I need to swap the parentheses
 
7:00 AM
Oh right, that too
 
 
1 hour later…
8:12 AM
@Bubbler second part used nested regex parsing
took a little while but very satisfying
 
8:24 AM
@RedwolfPrograms I need a bit of help streamlining this code and making it work consistently: gist.github.com/razetime/053c80f62b8b820b69721b18cdfc27eb
 
 
1 hour later…
9:40 AM
1
Q: Animal-Alphabetical Sequence

JyenasThe Animal-Alphabetical Sequence is an infinite string of letters built accordingly to the following procedure: Start with the letter A; Replace each letter with the name of the animal starting with such letter in the table below; Go back to step 2. For instance, the first four steps of the ...

 
 
2 hours later…
11:44 AM
Uncompressed strings in 05AB1E look so unnatural
 
12:16 PM
@Lyxal example?
 
12:35 PM
@Razetime 'A
 
1:35 PM
@Razetime A few things I noticed:
Actually never mind. I don't see too many issues with the script. What's inconsistent about it, does it just not load, or does it sometimes skip over messages?
You might want to replace the setInterval with a MutationObserever and some conditions, though.
 
2:09 PM
@RedwolfPrograms I put most of my problems in this question:stackoverflow.com/questions/65356239/…
@RedwolfPrograms hmm sure I'll check the documentation on it
@RedwolfPrograms it works on the first usage and sops sometimes
on chrome it doesn't work at all
 
It won't work on Chrome because the onload event already fired
You'll need to run the function immediately if document.readyState is ready
Also, you should probably be searching for pre, not code
 
hmm ok
@RedwolfPrograms thing is, inspect element shows only code tags
 
Oh, I guess it depends on whether you use the fixed font button or just put the whole message in a code tag
 
ok, that seems to remove the error
now the main problem is that ngn's apl isn't loading up
should I just force add a script tag
 
2:25 PM
Not sure, I've never used @require before
 
oh ok
 
3:12 PM
... I just typed dtf into Vi...
 
@Neil whats it mean
 
TIL the HTTP response code 418 is officially "418 I'm a teapot"
 
@Razetime Vim thinks it means "delete up to the letter f (but not the f itself)"
 
scary
well
vim does have undo right
 
3:27 PM
well, it is what I wanted to do
I just had a double-take as to what I had to type to achieve it
 
CMC: Given a binary function f (in whatever way you like, it's a CMC, I ain't fussed), and two integers a, b > 0, output the generalised Fib sequence a, b, f(a, b), f(b, f(a, b)), ... (for f = +, a = 1, b = 1, this is normal Fib)
 
@cairdcoinheringaahing Husk, 8
function on the second line
 
Not sure how to do that recursively with JS
 
@cairdcoinheringaahing ES6, 52
 
4:11 PM
hi all. I have a coding question.How much faster do you think stackoverflow.com/a/65331804/2287805 can be made?
 
4:50 PM
Man, hat season always confuses me because everyone's avatars change :/
 
5:16 PM
You'll need to use fuzzy matching, not a hash map
 
ngn
5:32 PM
@cairdcoinheringaahing output how many? can we take the count as an argument?
 
@ngn Standard rules; infinite output or take n and output either the first n or the nth
 
ngn
@cairdcoinheringaahing ngn/k: {*'x(|y\)\z}
(ctrl-enter to eval)
another example is the sequence from the euclidean algorithm - use ! (that's mod with reversed args) instead of +
@Anush in python? or can i use my own hammer?
 
Any hammer
Although python would be cool too
I think the code tries every paid of operations twice
But I don't know how to fix that
 
ngn
5:49 PM
@Anush composition of edits is not commutable though. "insert at 2, replace at 3" is not necessarily the same as "replace at 3, insert at 2"
@Anush there (i started solving your challenge last night, now i just finished it)
10?"ab" means pick 10 from "ab" at random
timing in milliseconds: \t f 10?"ab" (the web demo runs on wasm, but the interpreter can also run natively - faster)
 
6:12 PM
What language is that? I mean how do I run it?
 
ngn
you need clang-10 to compile it - run make in the project root
i assume you're on linux
 
It's official, I am the most bored Stack Exchange user.
Also take a look at that hacked fake score
 
7:10 PM
I am on Linux
 
ngn
@Anush do you have clang-10?
i think i recent gcc might work too
 
Hmm..I am on Ubuntu 20.04
Not at my pc now
What fancy features are you using?
You haven't submitted the answer yet have you?
 
ngn
@Anush i'm not sure. sometimes a __builtin_..() works in one compiler and not in the other
@Anush no, it was not completely done. i finished it when you asked for the python code review.
i'll submit it in a moment..
 
Cool
Whati I meant before is I think the code tries inserting at position i then j and later tries inserting at j then i
 
ngn
@Anush yeah, one of those is unnecessary but it would probably take more bytes to figure out which pairs can be optimized
 
7:20 PM
1
Q: Squarefree Palindromes

Neel ShuklaCreate the shortest function, program, or expression that calculates a sequence of palindromic numbers which do not have a square in their prime factorization You can find a list of the numbers from this link. The list goes as such : 1, 2, 3, 5, 6, 7, 11, 22, 33, 55, 66, 77, 101, 111, 131, 141, 1...

 
Yes. I meant to make it fast. I should write a separate challenge for that
 
ngn
@Anush but then c will win
 
8:07 PM
Yes it will win the c category :) All competitions are per language normally
Does your answer work with strings of length 30?
 
ngn
@Anush yes, 0.5s (on my machine)
 
@ngn C is not the fastest language these days.
Well-written APL can beat it.
 
ngn
@wizzwizz4 lol ;)
apl is not even the fastest language in the apl family of languages
 
8:29 PM
Is Fortran still faster than C?
I guess the right answer is, for what?
@ngn that's cool
 
0
Q: Find the number of ways to climb a stairway

Kjetil S. Challenge: Find the number of ways to climb some stairs with n steps and with some limitations. You should be able to run the tests below on TIO https://tio.run/ without timeout (which is about 1 minute now). The input is a list of positive numbers: the first number in the input is the total nu...

 

« first day (3611 days earlier)      last day (1215 days later) »