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
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
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).
@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.
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
(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)
It'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 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.
Today 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 ...
This 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)...
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))
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]]
Everyone 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 (...
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)
Alteration 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...
@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.
@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 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
@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
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.
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.
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?"
@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 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.