In this question, I found an answer that required no work, as the act of representing the input computed the output, on an extant, non-hypothetical system. Is this legit?
It seemed a lot like using a specifically designed language, but I didn't make this one up. And it does other, general-purpos...
@PeterTaylor So... I figured if this is going to be code golf, then the trick would be to choose k ≤ 7 instead of k > 7. But then I wonder a) can you really do better than hardcoding 7 solutions? And b) just because there's a provably finite time until loneliness doesn't mean that time is bounded, right?
To address a) I guess the input could be k-1 runners, and you're to find the kth runner which maximises time until loneliness, but still it's not obvious to me that there is an upper bound on that time.
The Goat, the Fence and the Grassy Loci code-golf geometry
Bob the farmer has gone on vacation and left poor Billy the kid goat tied to a fence! Fortunately for Billy, the fence is in the middle of a giant field of lush green grass. But unfortunately, thanks to the rope, Billy can't reach all of...
@MartinBüttner In addition to free Mathematica, I've just read that the raspberry pi also comes with free python scriptable Minecraft. I'm not familiar with it but now I'm imagining challenges combining the two...
@MartinBüttner "The rope will never be longer than the fence" isn't quite true. My problem is currently is whether or not to have such test cases, because these are the test cases which correspond to the regions on the "other side of the fence" overlapping
"Not wrapping more than once" is more like "Length of rope <= length of fence + minimum distance of Billy from an end of the fence"
@Sp3000 if they overlap, that means if I have two ropes of the same length, put one around the left and one around the right edge, they'd touch... which means they're twice as long as the fence... which means one rope is as long as the fence
@Sp3000 25 bytes in CJam, and I can probably still golf it
@Sp3000 The problem with the three circles problem is I don't think I'll find the time to solve it myself any time soon (which I'd need to in order to generate test cases)
I think for the fence+rope challenge overlapping is doable... I think you can only get 2 overlapping circles, because by the time you get a third one, it will be fully contained within one of the earlier two
My main problem is that irregardless of overlapping/not overlapping it just seems like a straight formula implementation and not much of a programming challenge
the proof showing equivalence with tightly bunched coprimes ;)
@PeterTaylor Well I'd have to read up on the background from the answers on Puzzling to know how to actually tackle this, but it's certainly an interesting problem.
There are a number of horizontal spacing macros for LaTeX:
\, inserts a \thinspace (equivalent to .16667em) in text mode, or \thinmuskip (equivalent to 3mu) in math mode;
\! inserts a negative \thinmuskip in math mode;
\> inserts \medmuskip (equivalent to 4.0mu plus 2.0mu minus 4.0mu) in math m...
CJam, 44 38 35 bytes
Using the same Conway's Algorithm as in here.
ll]_m*{~_,,@f>\f{\#!}2b}/\-:X--Xd\/
Input is the two same length but different sequences in two lines. The output is the probability of first winning over second.
I am using the formula for winning odds (p) for first player A...
@PeterTaylor What about a generalisation to n knishops? As far as I understand, the problem is really just "Is this an Erdos-Diophantine graph?" Is that problem significantly different for larger graphs?
Could do, although I don't think it's much more interesting. You pick two points, loop through all candidates relative to those two points, and check them against the other points.
4 reopen votes on the square challenge although it's still not entirely clear :( (and at least 2 of those were cast while the challenge wasn't fixed at all)
ah damn... I wanted to write the square root program in Prelude, to then port it to Fugue... but I totally forgot about the no-loop restriction... too bad.
11 answers already... including one or two from new users... it's just the thing that's going to go crazy on the HNQ.
@PopeyGilbert I agree, and I still don't think it's a particularly good question. But in that past that hasn't been an indicator for what's a popular question (unfortunately).
@IlmariKaronen I actually downvoted that loophole as well, because I think it's a matter of picking the right tool for the job. But if the community thinks that isn't cool, then I don't see why using GIF compression for a kolmogorov challenge is.
I know why my new function doesn't work - it uses a module level variable without declaring it global at the start of the function. What confuses me is that several of my older functions also refer to the same module level variable and seem to manage to read it and update it even though they don't declare it as global either...
I thought about asking on StackOverflow but even if I copy the code that works in one function to the new function, it stops working, so I don't know how to get it narrowed down to just the part that's a problem
@MartinBüttner It's a set, and several other functions read from and/or write to that set, and give no error and give expected behaviour.
I thought that maybe the new function was doing something different with it, but even copying a line from a working function into the new function results in the same error in the new function
It sounds so wrong that I'm sure I've overlooked something really obvious...
I'm going to try calling the old function from the place I currently call the new function
@Sp3000 I think this would be fun for a stack snippet interpreter though. Prelude is pretty simple to interpret (the Python reference implementation has 130 very readable lines). And then I might be able to build a Fugue interpreter on top of that.
Ahaha well it's basically the only sort of answer I'd personally be satisfied with, but even then you could argue that doing the lookup needs multiplication