« first day (3806 days earlier)      last day (1334 days later) » 

07:04
Okay, just as a quick sanity test before I post this to SO, here the most minimal example I could make of the bug. Run this in the console, and look at circuit.lights. If the second one has on equal to true, the bug didn't occur. If both are false, it did. You can try again with circuit.run(), then check again. It usually takes three or so tries for me.
The code's not very readable, I also hard coded as much as possible
@wasif one day when it's mostly ready
This is the most bizarre thing I've ever seen, and I've now 100% confirmed it's not my fault
There is nothing there that could cause nondeterminism to my knowledge
Wait a second
It's not nondeterministic, it's always the third run that fails
@lyxal have you made your full todo list
@wasif no
the todo list is actually more of a running joke
@Razetime No Patrick, mayonnaise isn't a programming language
07:10
@wasif because I mostly get around to doing things relatively quickly
@cairdcoinheringaahing Excuse me have you heard of the Mayonnaise programming language
Okay
This has gone from cursed to unbelievably cursed
A single console.log being commented and uncommented is changing the outcome of this program
It's console.log(lights[i])...it can't modify anything
So this is most likely an issue with V8
I'm going to need somebody else to confirm I'm not going crazy...
Run circuit.run() six times
Then comment out line 94, open a fresh console, and try it again
It's working for me now :|
Both ways
This is half scaring me and half very annoying
Wait never mind
I just got it backwards
The commented one is the janky one
Do y'all think this is proof enough to post on SO?
Seems to work fine in node
I'm going to try turning my laptop off and back on again, and if it works after that I am politely requesting someone to come stab me in the chest with a fork
Confirmed the weird behavior still happens after restart
07:31
hmm
CMC: Why won't today's xkcd code work?
@Adám ASLR: the museum creators cannot follow the head pointer because it's mapped differently in virtual memory
@RedwolfPrograms Can someone please try to repro this?
It'd be very useful for the SO post I'm drafting
am trying
what exactly do you want me to do? I don't really know what the code is supposed to be doing
Basically, when I run this in the Chrome 91 console, and manually run circuit.run() mayebe four times, the behavior suddenly (and unexpectedly) switches from printing 4 true to 3 true, and circuit.lights is not the expected value (false / true for the circuit.lights[x].on values).
07:36
@pxeger I was thinking something very simply: He uses smart quotes: “Item donation?” (They might even be backwards: ”Item donation?“)
If you run the circuit.run() function a few times by hand, it should switch to 3 true at some point, but only if you have that line commented
@Adám uh yeah that too
In Node (also uses V8):
@RedwolfPrograms my money is on the fact that because the logging is accessing the physical properties of the pins, it's creating some sort of mini delay that doesn't happen without logging.
You are running irl circuitry right?
07:41
No
It's just normal JS doing JS stuff
Simulating a very abstract representation of circuitry
@pxeger The problem with something like TIO is that I think it's a timing issue, so running all of the circuit.run() calls at once doesn't actually let you repro the issue
If someone else here could try it in chrome or firefox's consoles, that'd be the most helpful option
How can it be a timing issue? There's no timing going on
As in like something internal
Running it all at once seems to behave differently
Always outputs 3 true for me, until the 2nd time after circuit.toggles[0].on = true; when it outputs 4 true
But after that, does it revert back to 3 true?
That's the weird part
Since it changes for me depending on whether line 94 is commented
07:46
@RedwolfPrograms Compare: all at once vs. one by one
Is that the commented or uncommented line 94?
That's how uncommented should look
(Also the number before toggling doesn't matter much, but the number of times after toggling should be high enough to give it a chance to revert, maybe 6 times)
no, commented
exact same behaviour (minus the extra console logs) with it uncommented
Thanks!
You're on FF, right?
yup, Firefox 90.0b12
07:54
Thnaks. Posting to SO now.
0
Q: Strange behavior in Chrome 91: Logging changing outcome

Redwolf ProgramsIt's two in the morning and I think my laptop has ghosts in it. I'm sorry for the long MCVE, I spent a while shortening it by about 50% but I think this is the shortest I can get it without changing the logic, which seems to affect the outcome. Basically, when I run this in the Chrome 91 console,...

CMC: given a string, find the shortest palindrome that begins with such string. e.g. (abc -> abcba) and (fghh -> fghhgf) and (pqrq -> pqrqp)
also, is this complex enough to be a main post?
I think we had this exact CMC in a BMG not too long ago :p
And there was a question today or yesterday involving that problem, but it was
May 27 at 9:01, by Bubbler
in BMG Drafts, 2 hours ago, by Bubbler
Draft: Given a string of odd length "ABCDE", make it a palindrome like "ABCBA". (Replace the second half with the first half reversed)
this?
this is the only result
08:06
I remember the CMC very well, just can't find it :/
I remember it too.
Jun 8 at 16:00, by Redwolf Programs
CMC: Palindromise: given a string S output the shortest palindromic string that starts with S
i see
That was a very difficult post to hunt down, I had to search maybe ten things and my wifi decided to slow to a crawl :p
what can I say, great minds think alike
08:11
Anyway it's three in the morning here, see y'all tomorrow o/
See you later!
CMC: given a string S, output the shortest palindromic string P that contains S as a substring. if there are more than one, output any of them. e.g. abc -> acbca or cbabc or abcba or etc.
Ooh, that's nice.
Good enough for main, I think.
alright, submissions in chat are now closed
08:14
@LeakyNun ⊢,⊢/⍤⍸⍤(,⍨\⍤⌽≡¨,\⍤⌽)↓⌽ I think.
⍤⍸⍤
all I see are little eyes staring at me
@Adám I feel like I've already seen it
(on main)
I see
15
Q: Minimum insertions to make palindrome

Oliver NiToday you will be doing another palindrome challenge! So, your task today is to take a string, and determine the minimum amount of letters required to insert to turn it into a palindrome. For example, let's take the string fishes. In this, case the best way would be to add h if, so the result ...

CMC: output the following string: abacabadabacabaeabacabadabacabafabacabadabacabaeabacabadabacaba
08:33
smells like de Bruijn
inb4 it's on main
@pxeger no, it isn't a de Bruijn sequence
abacaba sequence one is about generating exactly that for various input size I think
alright
imma just never post CMC's again :P
36
Q: Generate the Abacaba sequence

LoovjoThis challenge is about printing the abacaba sequence of a specific depth. Here is a diagram of the first 5 sequences (a(N) is the abacaba sequence of depth N, upper/lowercase is just to show the pattern, this is not needed in the output of your program): a(0) = A a(1) = aBa a(2) = abaCaba a(3)...

@LeakyNun it can get shorter probably, but Vyxal 44 bytes
08:34
I mean, even if it's on main, it can still be a CMC right
people just have to... not look at the one on main
True
@LeakyNun CMC: Print "Hello, World"
just don't look at the one on main :P
@LeakyNun ngn/k, 16 bytes: {x,y,x}/"abcdef"
how on earth does that work
Reduce from left to right, making a new string of (current string, next char, current string)
08:37
interesting
CMC: biggest pristine NOP (program that does nothing (no output), but doesn't do nothing if any continuous substring of characters are removed (except removing all the characters))
@LeakyNun noooo
@pxeger Does erroring count as "doesn't do nothing"?
@Bubbler no
@pxeger APL: {}
08:39
@pxeger pristine?
@math there is a huge hello world question
@math no longer fulfills the challenge criteria if any continuous substring of characters are removed (except removing all the characters)
5 mins ago, by Leaky Nun
I mean, even if it's on main, it can still be a CMC right
@LeakyNun not pristine; it can be M instead of main
@wasif yes, don't look at the one on main (this was a joke question)
08:41
Well is pristine synonym of irreducible?
@wasif sort of
Pristine sounds better then
Pristine means "errors if any substring is removed"; irreducible means "no longer does what it's supposed to if any characters are removed"
Pristine originally meant a piece of code that does something as a whole, but errors whenever one or more chars are removed from it
^^ exactly
I see it's just like error quines for quines
Python pristine NOP "a"
I hope you can't remove all chars
08:44
no, it can be reduced to ""
Do empty Java programs error?
yes, they do
java hates it when you have no classes
great language
@pxeger Is Leaky's answer valid? Surely it errors when some chars are removed?
Then I think pristine programs aren't possible with python
@Bubbler but you can remove ain from Main and it won't error
@wasif nope; "" is pristine
it's just not very long
08:46
I mean I interpreted your answer as "the program may not error when some chars are removed"
Can you remove "" from "" lol
@wasif there's an exception for the empty program
so erroring sub-programs do not make an answer invalid?
so 0 is a possible Python answer
and I guess [] would be a longer one
CMC: given two positive non-zero integers n and m, return an n by m array of the first n times m natural numbers. E.g. f(3, 4) -> [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]
08:51
@lyxal J, 1+i.
Takes a single argument [n,m]
@lyxal Jelly, 3 bytes: ×Rs
@lyxal There really ought to be a short way of doing this in zsh using pr, but I can't find one
@lyxal ⊢⍴∘⍳×/ in APL.
Tag suggestion pls? i can't find any except math and code-golf
09:01
@lyxal {x#1+!*/x} in K
@pxeger thanks. is arithmetic good?
there's not really any arithmetic involved tbh
it's basically a string challenge, more than maths
ok, so string, parsing and cg
09:15
i doubt there would be that much parsing involved
Back again
@lyxal how to get non overlapping pairs in vyxal
I mean divide list into n equal non overlapping parts
@wasif 2ẇ
?
@math The regex for this would probably be /([\w)])\*([(\w])/g,"\1\2"
@Razetime what?
@Ausername 1..12 to 1-4,5-8,9-12
09:17
Then 4ẇ
Ok
@math do you understand regex
@Ausername thx
yes
@Razetime No
09:18
@lyxal Vyxal 4 bytes *ɾ¹ẇ
Noo
1 byte longer than jelly
@math then it shouldn't be too hard to understand
09:21
@Razetime i forgot some basic commands wait a sec
lmao what
@math Sure?
Regex is very hard to understand
@wasif i learned it some months ago
@Razetime sorry
@lyxal Japt, 6 bytes, ×õ òUÌ
09:22
@wasif it's a smaller dsl, takes lesser effort since it's mainyl constrained to string matching
@wasif I like how my answer represents the entirety of Jelly
also there's many, many challenges which benefit from regex, shaggy can confirm since he has like 1.5k answers
Which language makes the best use of regex?
QuadR / Retina
Nice
09:25
@wasif general purpose I'd say perl any day
Retina is better (in terms of regex use)
@Razetime i can't remember what / if for, nor did i find anything in the docs
@math / is the general regex delimiter in most languages
g implies a global match
@Razetime ah. not in python, i guess?
probably
09:28
@math python uses strings to represent regexes too
That's the most flexible (I think?)
okay, i'll try in JS
JS has a goddamn type just for regex!
CMQ: Which general purpose language has the largest core (less imports)
Not Python - it needs you to import stuff like randoms and regex...
Definitely not any C-style language
@wasif that's what I had
The r flag can be used for 3 bytes
09:32
Nice!
@wasif js?
@math maybe
Perl I guess
Raku
@Razetime Shall i still post the question even if it has an easy regex?
there a lot of languages which do not have regex
09:34
@Razetime example?
and there might me a more concise solution without regex
hi all
@Anush o/
@wasif K language
Jelly and 05 don't have it
still hoping that someone will add answers in C and Julia at least!
09:35
Jelly doesn't have regex??!!
@wasif Depends on the definition of "core", but Factor can be configured to load every single library in the default installation by default
in general purpose it is hard to find languages without regex
How?
On the other hand, pretty much all golfing languages have no libraries at all.
factor even needs to load kernel that's bad
That has the least core
@Ausername I asked for general purpose langs
@wasif Mathematica?
09:37
Yes we have the winner Mathemetica everyone else can go home now
You know, it has a built-in to determine if an image is a goat...
How did I forget that
mathematics loads from online, no?
@Bubbler ah yes the orientation of a goat
@Bubbler i thought just a built-in to see if an image is upside-down?
@math No, it literally tests if it looks like a goat in the given orientation
09:39
nope it also identifies the mammal
@math detecting a caprine animal
@Bubbler Uh...
Exactly not goat detection
It is funny that: GOAT -> Greatest Of All Time
@Razetime It does load some data from online (like biology or geolocation), but mathematics part mostly works without internet connection I believe
i think matlab might have some contention
09:42
How about R
R is not even close
R still needs imports
APL?
matlab and mathematics can create visualizations and gui out of the box
It is general purpose
09:43
@wasif nowhere near
APL family is pretty minimalistic
@Razetime you mean mathmetica
yeah
It's so hard to spell mathematica correctly :P
@wasif APL doesn't have a large stdlib, it prides itself on having a small group of functions which work on a large range of problems
09:44
You mean Mathematicalismisticimania, right?
@Bubbler it's hard tot type without typos
0
Q: Leave the times out!

mathEveryone knows, that you can leave the multiplication symbol (\$\times\$, or *) in a*b 23*a (2+3)*a a^(b*c) (a+b)*(c+d) out, but not in 2*3 => you don't want it to be 23 a*23 => most mathematicians just don't do it a^2*b => now it's (a^2)*b, if you remove the *, it's a^(2b) a/2*b => now it's (...

^ i'm away for a while, so ping please
@lyxal Does everything need to be either externally sourced or embedded?
10:33
HI All
Thanks to a long night of sitting up, calming the baby, I'm nearly done with my Thud challenge!
I don't know if this is something we'd do here, but would anyone be able to try an end-to-end run of my answering instructions? Just to check they're right?
https://codegolf.meta.stackexchange.com/a/23556/16824
(It's currently importing from a couple of meta questions, at the bottom, and you could just copy an existing client wholesale to save time)
0
A: Sandbox for Proposed Challenges

CrissovAlteration of a challenge that was considered too close to an older quasi-duplicate. ISO Computus algorithm? code-golf? date Your task is to calculate from a signed integer year number provided as sole input the integer number of the calendar week of Easter Sunday as sole output with as few varia...

10:54
@AJFaraday sure, I'll try it out
your reference implementation is very helpful
@Razetime That'd be great, thanks! I'll be on and off here all day if you want to ask questions
@lyxal Sorry about the branch juggling. Git can be a reak oaun sometimes.
@Ausername what do you mean by that?
I've mostly got it sorted now.
@Ausername you don't need to apologise for that...I myself know that branches can be absolutely painful.
11:04
@Razetime I'm glad the reference answers are helpful for you. Because it's such a long challenge I wanted to take away as much cognitive overhead as I could.
Does all my JS / CSS have to be embedded / imported?
@Ausername no
It can be single file if you want
Oh
Wait
You mean in regards to flask
Just because webserver
Yeah
Let me check
There's a way to link files via jinja templates
But I don't remember how
It's fine
It's fine. I already don't understand any of the {{...}} stuff, and it's only ~200 lines of CSS/JS in the parser.
@AJFaraday I suggest the tags
@Ausername if there's static files you need linked, I can handle that for you
That makes sense. Is there anywhere I can add them to the sandbox post?
generally people add then in the title using markdown: [tag:tag-name]
11:09
@Ausername place the files into a gist and I'll organise the directories and templates
@Razetime I've put them in to remind me, thanks
@lyxal I suppose main.html is a bit of a mess...
@AJFaraday can a single submission be submitted to compete both as a dwarf player and a troll player?
most of the functions seem to work on either side
@Razetime I'm not sure there could be a client that's worth submitting for both sides. The API is the same for both, but it still needs to make valid moves.
I'm sure there's a hacky way to do it, but alright
11:15
I suppose the short answer is that there's nothing stopping you putting the same code into answers on both questions, but it's unlikely they'd both be able to complete a game :p
@Ausername a necessary mess nonetheless
I remember there being a tag for asymmetrical KotH challenges, but it doesn't seem to be [asymmetrical]...
this has all ends wrapped up quite nicely
I like the elo-style points system, but
I think it may be more fair to add +1 to the winner and -1 to the loser
just stumbled across this pangram: "amazingly, few discothèques provide jukeboxes".
3
@Razetime Oh, I get why the points system is like that. It prevents early truces when the opponents have a single point in difference, making the games go on longer
11:22
So that's based on the actual official rules, where two players play a game, note the points difference, then swap sides and play again. That way it doesn't matter if the same side always wins, the biggest difference wins.
@AJFaraday ah this is another solid point
@Neil Has there been any pangram challenges on site?
@Neil is this a pangram in the french alphabet?
nah, I just chose the accented version from my spelling suggestions
ah ok
11:24
After doing a few test answers, the game is a bit more balanced than it looks. But I'm keeping this idea of ironing out the difference between the sides.
@AJFaraday anyway this looks complete and ready to post, kinda surprised not many people upvoted it
I don't think many people noticed it, to be honest.
@Razetime Would you mind posting an answer to one of the API sandboxes? I'd just like to check my automated importer is working.
sure I'll try
I just minified my parser/css and dumped it in there.
where
11:28
I mean, it's not like I'm going to be changing it any time soon, and I can always unminify it.
@Razetime main.html
@Razetime As I say, I don't mind if it's just a duplicate of an existing one, just to see that someone else can do it without issue
@Razetime Dwarf: https://codegolf.meta.stackexchange.com/questions/23642/stack-exchange-api-sandbox-dwarf-edition
Troll: https://codegolf.meta.stackexchange.com/questions/18632/stack-exchange-api-sandbox
Yep i found the meta posts already
@Razetime Sorry, I'm not sure I understood the 'where' question. Was that directed at me?
nah it was to @Ausername
Maybe someone choose not to upvote it as it is a troll question
... I'll see myself out
11:32
@AJFaraday When i open thud in the browser and edit the template, it doesn't allowme to move up a line. I can only type characters on the last line.
@N3buchadnezzar 👏👏👏
Very nice challenge =)
@Razetime Ahh, that's a known issue. One I honestly don't know how to fix. github.com/AJFaraday/Thud/issues/3 The workaround is to use Chrome.
@lyxal Why the </br>s?
strange. alright.
I can use backspace I guess
good thing i have chrome installed
11:34
It is mentioned in the question, and I'd like to get it out of the way, but I'm not sure how.
Is that on Firefox, or something else?
it was on firefox
Thanks
I had same issues on firefox (linux)
I would have put up a SO question about it, but I wasn't able to make a minimal reproduction of the issue. I'm pretty sure it's frowned on to just link to a git repo and go "what's wrong with this?"
@Ausername you mean at the end of the file?
11:36
Yes
@AJFaraday Are you sure the game's fair? The trolls seem to have a huge advantage, and I can just barely beat one of the basic troll ais as the dwarves.
@Ausername So that people have a choice whether or not they want to immediately see GEORGE and the Johnvertizsements
Oh true
But why </br> - Ummmm, HTML standards?
@Ausername So we were discussing this a bit further up, it's based on differences. So losing /less badly/ as a dwarf can still climb the rankings on the dwarf challenge.
@Ausername easiest way to space it
11:39
Sure...
It's less unbalanced than I thought it was :p
@Ausername hey don't judge me for being terrible at css and web design :p
Ok
I mean, I have this bit...
So the whole mess is in my fork, which you probably want to clone and have a look at.
I'll surge a static version.
put the code mirror and parser into separate files
and I'll incorporate them using flask and jinja templates
Seemsmy last question (albeit vry simple) was well recieved and got quite a few answers
I am happy!
11:48
@AJFaraday I attempted writing a controller but it says I'm not calling a valid move
module.exports = class{constructor(controller, utils){this.c=controller;this.s=controller.side;this.u=utils}
turn(){let p=this.c.pieces()[0];let m=this.c.check_space(p.x,p.y)[0];if(p&m){this.c.select_space(p.x,p.y);this.c.move(m.x,m.y)}else{this.c.declare(1)}}
end_turn(){}}
oh, it's a problem with checking space
Not much point now - Also, the static version is done!
hm
now i changed the thing and it still isn't completing a game aaaa
module.exports = class{constructor(controller, utils){this.c=controller;this.s=controller.side;this.u=utils}
turn(){let p=this.c.pieces()[0];let m=this.c.check_space(p.x,p.y).moves[0]||0;if(p&m){this.c.select_space(p.x,p.y);this.c.move(m.x,m.y)}else{this.c.declare(1)}}
end_turn(){}}
I think you can apply an invalid client and watch the game, and get the errors in the console

« first day (3806 days earlier)      last day (1334 days later) »