code-golf cops-and-robbers
Will it halt?
Cops:
This is the cops' thread. The robbers' thread is here.
Your challenge is to make a program that runs forever without halting1, unless it gets a particular input or inputs2. If it receives that input, it must terminate in a finite amount of time3....
@StepHen makes sense. if you have older friends who have already taken the courses (I'm guessing calc 1/2?) you can buy or borrow their book. But if you are not obligated to bring the book to class then you don't need to buy the physical book (and that's something you can ask the prof)
though you could say that all functions have to be injective (surjective?) because index -> char is injective (surjective?) but hashing isn't (i.e. hashing has collisions)
value.h:21:32: warning: its scope is only this definition or declaration, which is probably not what you want
In file included from value.c:1:0:
value.h:21:32: warning: 'struct Stac' declared inside parameter list
typedef void (*sopadic)(struct Stac);
@Downgoat Your website looks very nice but bug: if I move the cursor to the edge of the GitHub link circle and twitch it around along the edge, it will twitch around and not fully turn over xD
@HyperNeutrino that is because bounding box of bubble changes so 50% of the way as it turns the bounding box is smaller and suddenly you're not actually hovering over it which causes the problem
I could fix it using hidden div and sibling transitions but too lazy
binary_ops = {
PLUS: lambda x, y: x + y,
MINUS: lambda x, y: x - y,
MUL: lambda x, y: x * y,
DIV: lambda x, y: x / y,
INT_DIV: lambda x, y: x // y,
EXPONENT: lambda x, y: x ** y,
MOD: lambda x, y: x % y
}
Challenge
HP is doing research in mathematics . After doing lots of research, she struck in a problem . She found four numbers n,a, b and c .Now, She wants to know how many number exists which are less than or equal to n and are divisible by a ,b or c .
Input :
4 integers denoting n,a,b and c ...
An Integer is prime if and only if it is positive and has exactly 2 distinct divisors: 1 and itself. A twin prime pair is made of two elements: p and p+2, that are both prime.
You will be given a positive integer as input. Your task is to return a truthy / falsy depending on whether the given in...
@Dennis This bool chain feels insanely long &|P_ttQP_hhQP_ (for the new challenge on Main), I wonder If I can reduce it (especially the first part, | feels very ungolfy)
Last Thursday user @SpookyGengar delighted us with his/her first challenge about Making Squared Words. What if we double the number of sides?
The challenge
Take a string as input in any reasonable format you need (string, char array...) and output an octogonal representation of the input (also ...
Create a binary wall
code-golf binary ascii-art
Given an array of positive integers, n > 0, output their representation of a binary wall.
How does this work?
Convert each number to it's binary representation.
Pad the representation with leading zeroes to the length of the longest one i.e. 1,...
Should I allow empty inputs? Anyone got any preference on a test case?
end of the day they can take input from STDIN and give output to STDOUT, so I can have PHP receive the request, and pass the important stuff via STDIN to a golf-lang script, then echo the output of the script
I have been wondering a bit about that. You know how arguments appear to the right of operators (like in +5 or /'/regex/flags')? I have been wondering what the parser should do if the argument appears before the operator, like in 9^5+3.
There are few options: throw a syntax error, pretend that never happens, or have both the 5 and the 3 as arguments to the + operator
@Cowsquack Unless you're changing the way the language works I don't think using both is the best way yet. At the moment it appears they just get ignored so I'd stay stick with that or throw an error. But to be honest I think more features is a better thing at the moment than proper error throwing. I was just wondering.
@Cowsquack Well it's more your call, I haven't looked into the compiler/parser/whatever it's called so I don't know how awkward it would be to add, especially with more features, commands etc... later on.
Create a binary wall
code-golf binary ascii-art
Given an array of positive integers in base 10, where n > 0, output their representation of a binary wall.
How does this work?
Convert each number to it's binary representation.
Pad the representation with leading zeroes to the length of the lo...
Output execution time of your code
code-golfquine
Don't mistake this challenge for what it is not: it is quine-related.
Your goal
To output the execution time of your code.
Input
Nothing.
Output
The time your code took to execute. Your code can take as much time as you want. For example, ...
Given an array of positive integers in base 10, where n > 0, output their representation of a binary wall.
How does this work?
Convert each number to it's binary representation.
Pad the representation with leading zeroes to the length of the longest one i.e. 1, 2 -> 1, 10 -> 01, 10.
Create a w...
So, the question here is, if we find a challenge that is a duplicate, but the challenge it is a duplicate of has been closed as unclear or off-topic, should we still close the new challenge as a duplicate? For example, my question here, was closed as a dupe of a question that was closed as uncle...
@totallyhuman because the challenge is about converting to binary, then padding. You can't take input that is already converted to binary then padded. Its like taking Hello, World! as input for the hello world challenge