Search
Create a program P1 which takes as input a base 10 number N1 (the numbers for the variables are important). Given N1, P1 will print a program P2. P2 will take as input a base 10 number N2 and outpu...
About Negabinary Negabinary means base negative two (-2). That is, the $n$th place value is determined by $(-2)^n$. Negabinary numbers can be evaluated just like any other base system. For exampl...
Update: the meta tag is live, so we can start the posts. I have created a few here with a few sample answers, but the rest is up to the community! Make sure to vote on other answers as well as post...
Turing machines supporting multiple halt states may output with the state they halt on Similar to the exit code submission.
Using a non-free (beer) language on a cops-and-robbers challenge For a discussion on what counts as "free", see this post. Cops-and-robbers challenges have two components: a cop posts a program o...
How should we deal with flags / command line options when scoring entries?
How should we deal with golfing libraries when scoring entries? Continuation of Is my extension-like library allowed to be used in answers?, the answer to that question seems to be a "yes", now we...
Using inconsistent I/O An example would be a program whose only two outputs given some input can be 2 and 11. The program is print(11): claiming that it outputs in unary for some outputs and in de...
Optimizing specifically for the given test cases Applies to "code-speeding" or fastest-code where your program must run as quickly as possible, as well as compression challenges. Obviously, there ...
I have proposed that we shouldn't use nonfree languages to compete in cops-and-robbers challenges, but this proposal needs some demarcation. Matlab, Stata, LabVIEW all have finite free trials. Bat...
Yes Unless the challenge tells you what to name your function, you're free to use anything. This means that single character names are usually the best option. Note that anonymous function submis...
ROBBERS' THREAD A famous cops-and-robbers challenge whose source shall remain unnamed is brought to Codidact. You are a cop. You should write a program in a "famous" (has an English Wikipedia/Eso...
It's the opposite of code golf. Code bowling is essentially a challenge where you try to write the longest code possible, as opposed to the shortest code. Now, this format comes with many issues, ...
Challenge You will be given a string and an ascii art as input. The string must be placed above the ascii art, and centered based on its longest line. The text BOTTOM TEXT must be placed below...
I have seen KOTH (King of the Hill) challenges before but it's still unclear to me how to properly make, or even play, such challenge. To get started, how do I make (or solve) KOTHs? An answer cou...
Cracks Shaggy's answer Let the cops be "Cops" The conjunction is " and " The robbers are "Robbers" Say the cops with the conjunction with the robbers It can be one of: FALSE Phooe...
Python 3, 20 19 bytes lambda n:n**.5%1==0 -1 byte thanks to @shaggy : 0.5 -> .5 Try it online!
Disclaimer This challenge also exists in CGCC, but if you want to compete here (too), then hop in! Challenge Recreate "99 Bottles of Beer on the Wall", using the least bytes possible. Lyrics: ...
You may modify the input in-place If a function takes an input a, it is acceptable that a contains the intended output after executing instead of other forms of output. Note that this means a must...
C (gcc), 30 bytes f(x,y){return x+y|!(x^y|x^2);} Try it online! In case the "preferably on a function" requirement can be dropped, then #define f(x,y)x+y|!(x^y|x^2) is 28 bytes.
Haskell, 20 bytes f x=foldl((+).(x*))0 Try it online! Takes input coefficients from highest degree to lowest. 21 bytes x%(h:t)=h+x*x%t x%_=0 Try it online!
Common Lisp, 26 22 bytes (princ"Hello, World!") -4 bytes thanks to @Sisyphus Try it online!
Ruby, 50 bytes def f(k,x)k.length>1?k[0]+f(k[1..-1],x)*x:k[-1]end Try it online! This uses the Horner's method recursively, because I think it'll be slightly shorter than using a loop or bu...
JavaScript (Node.js), 137 136 117 bytes with(Math)f=n=>(m=(a,b)=>a?m(--a,b)+b(a):[])(28,y=>m(55,x=>x>26-y&x<y+28&(x^y)?min(abs(abs(27-x)-y)/2,27-y):' ')+` `) Try it...