Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Activity for AndrewTheCodegolfer‭

Type On... Excerpt Status Date
Question Tiny Turing-completeness
Your challenge today is to golf a program to interpret something Turing-complete. You may use any Turing-complete system for this so long as it is not the source language of the challenge - even a Turing-complete subset of the emulated language. You may not directly evaluate code using a builtin w...
(more)
over 2 years ago
Question Guess the language! (Robbers' Thread)
COPS THREAD A famous cops-and-robbers challenge whose source shall remain unnamed is brought to Codidact. You are a robber. Your goal is to find answers on this link which haven't been cracked and to crack them, aka reveal a language in which they work. If you have found such a language, reply ...
(more)
almost 3 years ago
Answer A: Default Rules: Loopholes
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.
(more)
almost 3 years ago
Question Guess the language! (Cops' Thread)
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/Esolangs/Rosetta Code page) language that prints `Cops and Robbers`. That's all it does - prints exactl...
(more)
almost 3 years ago
Answer A: How free is "free" for cops and robbers?
Languages with free online interpreters are free This includes all languages currently on tio.run, for example.
(more)
almost 3 years ago
Answer A: How free is "free" for cops and robbers?
Platform specific languages are free if there is a free implementation on another platform (or of the platform which the lang is native to) Although Batch is exclusive to Windows, Windows can be put on a VM easily. Same thing for AppleScript and MacOS.
(more)
almost 3 years ago
Answer A: How free is "free" for cops and robbers?
Free access must not be finite There has to be a time-unlimited, free way to run the language in question.
(more)
almost 3 years ago
Question How free is "free" for cops and robbers?
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. Batch and AppleScript can only be used on Windows and Mac OS, and it's illegal to emulate TI-BASIC even t...
(more)
almost 3 years ago
Answer A: Default Rules: Loopholes
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 all programs are ignored and instead execution depends on time since epoch.
(more)
almost 3 years ago
Answer A: Default Rules: Random
My thoughts on the matter > Does randomness need to be uniform? Nope, although it has to follow the specifications of the challenge (but if the challenge is too demanding with its randomness you may freely vote on the matter). > Can you use unseeded PRNG? For functions, sure thing, but fo...
(more)
almost 3 years ago
Answer A: Default Rules: Code Golf I/O
Image output may be a pixel shader A pixel shader inputs `x,y` coordinates of a pixel and prints the color of a pixel (scalar for grayscale, tuple for full color, bool for binary...). Relevant for Shadertoy/GLSL answers and graphical output challenges.
(more)
almost 3 years ago
Answer A: Default Rules: Code Golf I/O
Programs/functions may use the presence/absence of output as a bool
(more)
almost 3 years ago
Answer A: Default Rules: Code Golf I/O
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.
(more)
almost 3 years ago
Answer A: Default Rules: Loopholes
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 challenge was posted are like features that were added after the challenge was posted and there's no easy...
(more)
almost 3 years ago
Answer A: Default Rules: Code Golf I/O
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 with currying. (You might take a list or tuple of the values but this isn't the natural way to do multi-...
(more)
almost 3 years ago
Answer A: Default Rules: Loopholes
Empty answers to questions requiring an interpreter In particular, - "simulating" a machine on this very machine by accepting the initial state as the simulation's initial state and returning the final state as its own final state - "interpreting" a language with an empty program that "takes...
(more)
almost 3 years ago
Answer A: Default Rules: Loopholes
Bypassing source restrictions by storing data in the file name In some languages, like Pxem, programs are usually stored in the file name and the file's contents are irrelevant. On Somewhere Else, a Pxem answer has been disqualified before because the file content did not adhere to restrictions ev...
(more)
almost 3 years ago
Answer A: Default Rules: Loopholes
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 print a falsey output would violate this loophole. Of course Brainfuck can't connect to the internet.
(more)
almost 3 years ago
Answer A: Default Rules: Loopholes
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 is a finite amount of cases because we have to measure speed/compression somehow. It's not in the s...
(more)
almost 3 years ago
Answer A: Default Rules: Loopholes
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 like Boolfuck whose only integer type is the 1-bit integer. With a minimum of one bit of input and one...
(more)
almost 3 years ago
Answer A: Default Rules: Code Golf I/O
Regexes may output via the list of matched strings (capture group 0)
(more)
almost 3 years ago
Answer A: Default Rules: Code Golf I/O
Functions may return bools via the presence/absence of an error Crashing to mean `false` and not crashing to return `true`. Another branch of the exit code answer.
(more)
almost 3 years ago
Answer A: Default Rules: Code Golf I/O
Programs may take input from prompts from the GUI For Mathematica, JS, Matlab, et. al. this is the closest thing they have to STDIN.
(more)
almost 3 years ago
Answer A: Default Rules: Loopholes
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 decimal for others shouldn't be allowed even if output in either of these is allowed.
(more)
almost 3 years ago
Answer A: Default Rules: Loopholes
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 optimized to be as good as possible in some property and a robber tries to invalidate the program. An...
(more)
almost 3 years ago
Answer A: Default Rules: Code Golf I/O
Turing machines supporting multiple halt states may output with the state they halt on Similar to the exit code submission.
(more)
almost 3 years ago
Answer A: Default Rules: Code Golf I/O
Turing machines may use the contents of their tape pre-execution as their input
(more)
almost 3 years ago
Answer A: Default Rules: Code Golf I/O
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 space for a user-created structure.
(more)
almost 3 years ago
Answer A: Default Rules: Code Golf I/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.
(more)
almost 3 years ago
Answer A: Default Rules: Loopholes
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. Another example would be a program that executes a program in another file instead of computing the Fibonac...
(more)
almost 3 years ago
Question A number adder, not a death adder
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 output N1+N2. P1 and P2 have to be in the same language. If your language doesn't have STDIN, for P1 an...
(more)
almost 3 years ago
Answer A: "Hello, World!"
///, 13 bytes ``` Hello, World! ``` Someone had to. 18 bytes using replacement ``` /x/H/xello, World! ``` 23 bytes using two-layer replacement ``` /a/Hello, World!//b/a/b ``` `a` is replaced with `Hello, World!` in `/b/a/b`, creating `/b/Hello, World!/b` which prints `Hello, World!...
(more)
almost 3 years ago
Question Versatile self-printer
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 a proper quine, although it can append newlines in a language that absolutely requires them. Only ...
(more)
almost 3 years ago
Answer A: Obligatory Quine Challenge
h, 4 bytes ``` 1,-1 ``` Neither this program (by VilgotanL) nor the language (by Nerdaxe) are mine, but I think the latter is interesting and so I am submitting the former. Step-by-step guide: ``` Accumulator and index of the current cell start at 0 Acc -> (value of 0th cell)th cell - 0 -...
(more)
almost 3 years ago
Question Create a Sudoku
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 that compose the board have all of the digits from 1 to 9. Your output may look like this: ``` 12...
(more)
almost 3 years ago
Answer A: Evens or Odds - you know this one
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!
(more)
almost 3 years ago
Answer A: Evens or Odds - you know this one
Mathematica, 4 bytes ``` OddQ ``` Not at all my code - this is the original post by Martin Ender. Prints `True` for odd inputs and `False` for even inputs.
(more)
almost 3 years ago
Question Evens or Odds - you know this one
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 leading 0s) and outputs something if the number is odd or something else if the number is even. You M...
(more)
almost 3 years ago