@Dennis ¯\_(ツ)_/¯ It adds another element to the game, especially at really fast time controls.
At a certain point (like ½+0, which ProgramFOX just implemented on lichess) it begins to become a contest of "who can throw pieces around with some semblance of knowing what they're doing the fastest," though...
I wish that were the case here. There's a supermarket near my parents where you can walk just a couple aisles from childrens' toys to assault rifles. ._.
Well, a civilian can't own an assault rifle in Germany. There are limits. My dad was into old-fashioned guns, which you had to load with black powder and stuff. Jack Sparrow style.
I don't think there are truly safe areas in third world countries. But I used to do shooting practice with my shot gun in my back yard until all the kids of the neighborhood had seen me. Nobody got even near my house since then.
(from zh-CHS) Ice Ice romance song of ice and fire-ice and fire of youth drug drugs curling curling curling pictures of ice curling, curling game ice fruit
This issue has come up after receiving an answer to one of my questions. For the sake of clarity, I asked programs to take in two pieces of input. This answerer found it easier to read the two inputs in as one string and to not put a separator between them (since been changed). 1) Is it reasonabl...
@AlexA. I know it's possible in C, so it should be possible in C++. But did you mean passing another function as an argument or passing itself as an argument?
Declaration
A prototype for a function which takes a function parameter looks like the following:
void func ( void (*f)(int) );
This states that the parameter f will be a pointer to a function which has a void return type and which takes a single int parameter. The following function (print) ...
In your first and last code examples, the * is not compulsory. Both the function parameter definition and the f function call can take f just as is without *. It might be a good idea to do it as you do though, to make it obvious that parameter f is a function pointer. But it hurts readability quite often. — GauthierFeb 22 '12 at 12:52
That explains it then
Even better, since this is C++ rather than C, I can use std::function<int (int)> with #include <functional> in the C++11 stdlib.
@quartata Maybe. I'd still like to find someone else who has LabView and can test that it works, because it doesn't seem to have enough logic to handle all the cases.
But the scoring is really incomparable with bytes, and should only be considered for atomic-code-golf
@AlexA. It's about as rude as the C-word which someone on radio once accidentally called British politician Jeremy Hunt.
I got Onion Knight, but I don't even know which of the two xkcd challenges it's for. Read is more popular and active, but Convert has been very quiet for much longer.
@PeterTaylor @quartata Yeah, I accepted Eumel's answer because I couldn't see anything wrong with it. Should I take it back while people figure out how to test these answers?
Relevant links here and here, but here is the short version:
You have an input of two integers a and b between negative infinity and infinity (though if necessary, I can restrict the range, but the function must still accept negative inputs).
Definition of the Kronecker symbol
You must return ...
Given two inputs q n determine if q is a quadratic residue of n.
That is, is there an x where x**2 == q (mod n) or is q a square mod n?
Input
Two integers q and n, where q and n are any integers 0 <= q < n.
Output
A truthy or a falsey.
Optionally, print any (or all) x that is x**2 == q (mod...
There's quite a few challenges on this site that ask you to print out a sequence, and this is no exception.
(The following explanation of the sequence for this challenge assumes the symbols in the sequence are 0 and 1.)
The recursive definition of the Thue-Morse sequence is that
T_0 = 0
T_2n ...
Let's map some strings to 2d space, fractal style. Your task is to compute a Hilbert curve and lay a string along it.
Task
The task is to take the single-line input string, and lay it out along a Hilbert curve big enough to contain it, but no bigger. Try to make the byte count as low as possi...
Well, I haven't really started working on it, but I've got some ideas written down for it. I'm currently working on something else. So if you wanted to you could certainly beat me to it. ;)
{.(,-)^:] works for 9 bytes with some rule stretching (which has been allowed). E.g. for 5 it outputs 5 _5 _5 5 _5. (Added only as a comment because of the rule stretching.) — randomra3 mins ago
@wizzwizz4 I don't really understand the layers, and the Hilbert curve, but my draft also involves super mushrooms and changing between 1 and 2 block height
The Hilbert curve is basically a way of getting each layer (which could be a level in its own right, almost) into one line. Imagine a cube. Each layer is a cross-section of the cube.
Let's map some strings to 2d space, fractal style. Your task is to compute a Hilbert curve and lay a string along it.
Task
The task is to take the single-line input string, and lay it out along a Hilbert curve big enough to contain it, but no bigger. Try to make the byte count as low as possi...
one of my main design goals (and the reason I haven't started working on this yet) is that I want to be able to define a 1:1 mapping between tiles from SMB1 and commands, such that the levels can actually be rendered and look like a real level (and vice versa... real levels should be code, even if it doesn't do anything meaningful)
heh, I just found an old-ish challenge which I thought could use a CJam answer... after posting it, I realised that I had already answered that challenge in Mathematica (relatively shortly after starting being active on PPCG)... and looking at that Mathematica answer realised I could golf it from 28 down to 20 bytes o.O
Python 3, 469 bytes
The way this works is that I make the Hilbert curve using a Lindenmayer system and follow the left, right and forward instructions along an array of strings. There are probably many ways this could be golfed better, though; especially in the conditionals and in making the arr...
Introduction
Santa has too many names to process, and needs your help! He needs you to write a program or a function, which outputs nice, naughty, very naughty or very very naughty. To determine how nice or naughty someone is, Santa had developed an algorithm:
Nice (division, math):
First of a...