Posts by AndrewTheCodegolfer
Outsourcing the answer to unofficial conditions An example would be a program to print the Fibonacci numbers: instead of actually computing them, it queries an API and gives back its output. Anoth...
Interpreting the challenge too literally If the challenge asks that you print the nth prime given input n, a program printing the nth prime given input n isn't allowed.
Functions may take multiple arguments with currying For some languages like Haskell this is almost a necessity, as only one-argument functions exist and multi-argument functions are implemented wi...
Using the lack of features in a language to trivialize the problem For example, in a challenge which requires your program to check if it is connected to the internet, using Brainfuck to always pr...
Get ready for a comparatively dry question - this is intended to be one of the "the"s of the code-golfing dictionary. Create a program which inputs a base 10 non-negative whole number (without lea...
Programs may take input from prompts from the GUI For Mathematica, JS, Matlab, et. al. this is the closest thing they have to STDIN.
Regexes may output via the list of matched strings (capture group 0)
Multiple URL shorteners in a web-based challenge In challenges which require fetching data from the Internet, URL shorteners can be problematic. This is because: shorteners made after the cha...
Using your languages of choice, golf a quine - a non-empty program taking no input and only outputting its source. Here, the win condition is your quine working in the most languages. It should be...
Regex, 8 bytes [02468]$ Matches strings ending in one of 0, 2, 4, 6, 8. [13579]$ is equivalent but with opposite outputs. Try it on Regex101!
In languages without STDIN (eg ///) programs may input through insertion into the source code Also applies to cellular automata, in which the most natural way of taking input is specifying some sp...
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 ...
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...
Turing machines supporting multiple halt states may output with the state they halt on Similar to the exit code submission.
Write the shortest program that takes no input and outputs a Sudoku solution. For reference, a Sudoku solution is a 9x9 grid of digits where each column, each row and each of the nine 3x3 grids th...
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...
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...
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...
Programs may output via exit code Exit codes are to programs what return values are to functions, so it makes sense that exit codes would be allowed.
Abusing native number types It's common to restrict inputs, outputs, intermediate algorithm values, etc. to fit into the native number type of the language. This can be a problem for languages li...
Numerical I/O may be given as a character code Input 64 may be given as @ instead. This mostly exists for languages like Brainfuck that only take input through character codes.
Storing information in the platform specs We should disallow requiring the program to be run on some platform to store information for the challenge. An extreme example would be Nullary, in which ...
Free access must not be finite There has to be a time-unlimited, free way to run the language in question.
Languages with free online interpreters are free This includes all languages currently on tio.run, for example.