This "sandbox" is a place where Code Golf users can get feedback on prospective challenges they wish to post to main. This is useful because writing a clear and fully specified challenge on your first try can be difficult, and there is a much better chance of your challenge being well received if you post it in the sandbox first.

Sandbox FAQ


To post to the sandbox, scroll to the bottom of this page and click "Answer This Question". Click "OK" when it asks if you really want to add another answer.

Write your challenge just as you would when actually posting it, though you can optionally add a title at the top. You may also add some notes about specific things you would like to clarify before posting it. Other users will help you improve your challenge by rating and discussing it.

When you think your challenge is ready for the public, go ahead and post it, and replace the post here with a link to the challenge and delete the sandbox post.


The purpose of the sandbox is to give and receive feedback on posts. If you want to, feel free to give feedback to any posts you see here. Important things to comment about can include:

  • Parts of the challenge you found unclear
  • Comments addressing specific points mentioned in the proposal
  • Problems that could make the challenge uninteresting or unfit for the site

You don't need any qualifications to review sandbox posts. The target audience of most of these challenges is code golfers like you, so anything you find unclear will probably be unclear to others.

If you think one of your posts requires more feedback, but it's been ignored, you can ask for feedback in The Nineteenth Byte. It's not only allowed, but highly recommended! Be patient and try not to nag people though, you might have to ask multiple times.

It is recommended to leave your posts in the sandbox for at least several days, and until it receives upvotes and any feedback has been addressed.


Search the sandbox / Browse your pending proposals

The sandbox works best if you sort posts by active.

To add an inline tag to a proposal, use shortcut link syntax with a prefix: [tag:king-of-the-hill]. To search for posts with a certain tag, include the name in quotes: "king-of-the-hill".

  • \$\begingroup\$ What if I posted on the sandbox a long time ago and get no response? \$\endgroup\$
    – None1
    Commented May 15 at 14:05
  • \$\begingroup\$ @None1 If you don't get feedback for a while you can ask in the nineteenth byte \$\endgroup\$
    – mousetail
    Commented May 29 at 13:27

4703 Answers 4703

76 77
79 80

Assassin KoTH


Each bot is a point in the 2D plane. Each game, the list off bots is shuffled and each bot is a particular bot as their mark. This is done such that there is a cycle of assassins and targets.

Each bot's goal is to kill their mark and avoid their assassin. They can kill their target by getting within a certain distance to them. When they kill their target their new target is their target's assigned target. This continues until there are two bots left in the arena. Then each bot scores their kill count and the two remaining bots score their kill count plus a bonus.


  • What should the bonus for being one of the remaining bots be?

  • Should the game take place on a grid instead of a 2D plane?

  • Should there be a time limit?

  • Is creating a bot accessible enough or is the game too complicated?

  • Any other feedback?

  • \$\begingroup\$ I think the bonus should be the number of bots in play. \$\endgroup\$ Commented May 3, 2021 at 9:00
  • \$\begingroup\$ @StackMeter Wouldn't that heavily bias the game in favour of camping? Getting kills and dying early should still be a viable strategy. \$\endgroup\$ Commented May 3, 2021 at 9:19
  • \$\begingroup\$ Yeah, I see what happens what that in place: maybe you get double your score, so campers get 0 if they last to the end (0 * 2 is still 0). \$\endgroup\$ Commented May 3, 2021 at 9:52
  • \$\begingroup\$ @StackMeter Camping still needs to be a viable strategy though - more variety is better. \$\endgroup\$ Commented May 3, 2021 at 10:32
  • \$\begingroup\$ 50*(kill/total bot)+survival bouns(5) or something similar. \$\endgroup\$
    – okie
    Commented May 10, 2021 at 1:41

Sum multiplication carries

We have already counted how many carries are there in a sum. But what's their sum in a multiplication?

A carry is a digit that is transferred from one column of digits to another column of more significant digits.

When multiplying 15 and 3, a carry of 1 happens:

               1          1
   15          15         15
×   3   ->  ×   3  ->  ×   3
-----       -----      -----
                5         45

When multiplying 123 and 9, two carries of 2 happen:

               2         22         22
  123         123        123        123
×   9   ->  ×   9  ->  ×   9  ->  ×   9
-----       -----      -----      -----
                7         07       1107

When multiplying 23 and 52, a carry of 1 happens on the tens:

                                     1           1          1 
   23          23         23         23          23         23
×  52   ->  ×  52  ->  ×  52  ->  ×  52   ->  ×  52  ->  ×  52
-----       -----      -----      -----       -----      -----
                6         46         46          46       1196
                                     5         115        

When multiplying 67 and 89, a carry of 6 happens on the ones and a carry of 5 on the tens.

               6          6          5           5          5 
   67          67         67         67          67         67
×  89   ->  ×  89  ->  ×  89  ->  ×  89   ->  ×  89  ->  ×  89
-----       -----      -----      -----       -----      -----
                3        603        603         603       5963
                                     6         536        

When multiplying 3 and 2, no carry happens, as well as 5 and 2.


  • Two positive integers.


  • The sum of all carries that occurs when these two numbers are multiplied in base 10.

Test cases

15, 3 -> 1
123, 9 -> 4
23, 52 -> 1
67, 89 -> 11
3, 2 -> 0
5, 2 -> 0
3125, 5 -> 3
257, 34 -> 7
21, 10 -> 0

Any suggestions? More test cases?

  • \$\begingroup\$ Wont 23×52 cause 2 carries of 1 happened? As 2×5 also give a carry of 1? \$\endgroup\$
    – tsh
    Commented May 11, 2021 at 2:29

A general-purpose macrogenerator

Briefly: Implement Christopher Strachey's “General-purpose macrogenerator”.


In section 1.2 (Historical References) of the manual for GNU M4, an early macro processor is mentioned:

An important precursor of m4 was GPM; see C. Strachey, “A general purpose macrogenerator”, Computer Journal 8, 3 (1965), 225–41, http://dx.doi.org/10.1093/comjnl/8.3.225. GPM is also succinctly described in David Gries’s book Compiler Construction for Digital Computers, Wiley (1971). Strachey was a brilliant programmer: GPM fit into 250 machine instructions!

Your goal is to implement GPM, as described below, in the fewest bytes of source code possible.


The version of GPM in this challenge is very close to that described in the original paper. GPM operates quite like m4, but there are some important differences. I assume that you already have an idea of what a macro is in general.

Input to GPM is a sequence of ASCII characters, which should be copied to the output verbatim, except that macros calls are expanded. Macro calls consist of a dollar sign $ followed by a name, followed by a comma ,, followed by a comma-separated list of arguments, followed by a semicolon ;. Here is an example of a macro call:


In this case the name is macro, and there are three arguments (x, yy, and z). A macro call with no arguments is the name preceded by $ and followed by ;, as in $noarguments;.

Macro names consist of letters and/or digits. (So 1232 is a valid name.) There are no limitations on the length of a name.

When a macro call is encountered, it is replaced by the text currently associated with the name. (How text is associated with a name will be explained later; it is done by a macro named DEF.) This replacement text is also a sequence of characters suitable for input to GPM; in particular, it may itself include other macro calls. However, occurrences of ~1, ~2, ~3, etc. are replaced by the text of the corresponding argument given. The string ~0 is replaced by the macro's name.

Macro calls can be arguments, as in $macroA,$macroB,$macroC;,$macroD;;;. Dollar signs and semicolons must be balanced. Even the macro name in a macro call can be a macro call, so that $$x;; is valid.

The name and arguments are evaluated from left to right before replacement begins. It is not a problem if more arguments are given than are used by the replacement text.

After the call has been replaced, the resulting text is re-examined, in order to allow further expansion.

For example, suppose that macro names a macro whose replacement text is ~1~1~2~2~3~3. Then the call given previously, namely $macro,x,yy,z;, would be replaced by xxyyyyzz.

Outside of a replacement text, the meaning of ~ followed by a digit is undefined. Your program need support only nine arguments, numbered ~1 to ~9.

The usual treatment of a string of characters can be prevented by using the “quotes” < and >: Characters between < and > are not examined for macro calls. The evaluation of a quoted string is the string between the quotes but without the quotes. Quotes can nest.

Quoted text need not be valid input. Thus <$> and <;> are OK. It is not possible to quote a quoting character: <<> and <>> are invalid. However, <<><>> is fine; it evaluates to <><>.

Here are some examples, mostly taken from Strachey's paper. Assume that the following definitions are active:

Name Replacement text
A A~1A
B B$A,X~1X;B
APA P~1~1P

Then we will have

Input output
$A,ACA; or $A,$A,C;; AACAA
$$A,P;,Y; PYYP
Q<$A,C;>R Q$A,C;R
$A,<$A,X;>; A$A,X;A
Q<$>R<;> Q$R;
Q<<$A,C;>>R Q<$A,C;>R

Macro definitions

GPM maintains an environment of macro definitions, which is an ordered list of pairings of names and replacement texts. Entries are added and removed in a last-in-first-out manner. When it is time to expand a macro, the name is searched for in the environment, beginning with the most-recently-added definition and moving backwards. The first matching definition is the one used.

After an expansion has finished, the environment returns to the state it was in before the expansion begun. Thus any macros defined in the process are forgotten.

The built-in macro DEF can be used to modify the environment. It takes two arguments; the first is the name to define, and the second is the definition. The DEF macro is treated just as any macro is, except that the first argument, the name, is not evaluated. The effect of DEF is always to add a new definition to the environment, rather than to change an existing one.

Here are some definitions for simple arithmetic:


The output of $Sum,3,4,2; is the sum of \$34\$ and \$2\$, expressed as 3,6.

Another basic macro, VAL, takes a name (which is not evaluated) as an argument and returns its unevaluated definition. Thus after defining $DEF,A,A;, $VAL,A; gives A (without evaluating it and getting into an infinite loop).

To change a definition, instead of (possibly temporarily) overriding it, the UPDATE macro is available. It is used like DEF, but changes the currently active definition of the name and does not add an entry. There must already be a definition before calling UPDATE.

The expansion of DEF and UPDATE is empty.

No limitations are placed on the number of characters making up a macro's replacement text. In the original program, the size of the new replacement text after an UPDATE call was restricted to being at most as long as the previous definition. You need not implement this restriction, but you also need not remove it.


Your program can get input from a file, from standard input, or from a string. Output can be to a file, to standard output, or to a string.

Whitespace (ASCII space, horizontal tab, vertical tab, line feed, carriage return) should be ignored but copied to the output. Thus $ n a m e; is the same as $name. Strachey's implementation most likely did not differentiate between uppercase and lowercase letters, so you do not have to. The test does not depend on case differences.

Strachey's paper includes a detailed discussion of GPL's implementation, which you might find useful/interesting. It is not particularly easy to read. I don't think the 250-instruction machine code program has survived anywhere.

User tociyuki on GitHub has implemented the algorithm in Ruby and published it as a Gist, although UPDATE is not supported. I have not tested it.

Previously I have remarked that name length and replacement text size are not limited. This was true of Strachey's program but only to a certain extent. He enforced a limit on the total number of characters stored, but the length of any name or text was not fixed. You can do this as well, but your program must support storing at least 10000 characters, as he suggested.

Your program should allow at least 100 levels of expansion.

Don't bother with handling erroneous input; if given something invalid, your program can do anything.

Test case


$DEF,A,<A~1A>; /* First line of output
This should be the second line of output.
The expansion of Suc is $VAL,Suc;.
And I wrote that by saying: <The expansion of Suc is $VAL,Suc;>.
<<<Quote quote quote>>>
$A,ACA; = $A,$A,C;;
Q <  <  $  A  ,  C  ;  >  >  R */
#include <<stdio.h>>

int main(void)
        puts("Unaffected by the processor.");
        printf("Here's a sum: 34+2=%d%d.\n",$Sum,3,4,2;);


Expected output:

/* First line of output
This should be the second line of output.
The expansion of Suc is $1,2,3,4,5,6,7,8,9,10,$DEF,1,<~>~1;;.
And I wrote that by saying: The expansion of Suc is $VAL,Suc;.
<<Quote quote quote>>
Q<$A,C;>R */
#include <stdio.h>

int main(void)
        puts("Unaffected by the processor.");
        printf("Here's a sum: 34+2=%d%d.\n",3,6);

I believe that the computer for which Strachey's machine-code program was written used forty-eight-bit words (at least its predecessor did), so the mark to beat is 1500 bytes.


Complete the Square (UNFINISHED)

Completing the square is (part of) a method for solving quadratic equations, which involves turning something like this:


Into something like this:


I'll show how I was taught to do this. Take the quadratic \$2x^2-8x+16\$. First, divide out \$a\$:


Now, the goal is to add a number inside the parentheses which makes the quadratic the square of an \$(x-n)\$ term. In this case, adding \$-4\$ would result in \$x^2-4x+4\$, the square of \$(x-4)\$.

Importantly, you also need to subtract a number (outside the parentheses) in order to keep it the same overall. This results in:


Which can be simplified to:


This can be used to solve quadratics, by rearranging that result a bit:



Not sure what a good task would be for this but I already typed it all so I'm not discarding it :p

  • \$\begingroup\$ I believe you can simply apply the quadratic formula and get \$k=c-\frac{b^2}{4a}\$ and \$h=-\frac{b}{2a} \$. Since you are just writing down how to get that formula step by step \$\endgroup\$
    – tsh
    Commented May 12, 2021 at 9:38
  • \$\begingroup\$ @tsh That's the main reason I'm not sure what the task should be, since I don't want it to just be another "stick these values into a formula" challenge :p \$\endgroup\$ Commented May 12, 2021 at 13:29
  • \$\begingroup\$ @RedwolfPrograms Not sure there's a good challenge buried in here. \$\endgroup\$ Commented May 12, 2021 at 20:05
  • \$\begingroup\$ @DonThousand Yeah that's what I was worried about :/ \$\endgroup\$ Commented May 12, 2021 at 20:17
  • \$\begingroup\$ Any feedback on either of my two recent challenges in Sandbox? \$\endgroup\$ Commented May 12, 2021 at 20:19

CGCC sings a song together

  • \$\begingroup\$ Does "languages can only be used once" mean that each user can only use each language once, or each language can only be used at most one time in the entire challenge? i.e. if Alice uses Language A, can Bob use Language A in his answer? \$\endgroup\$
    – user101133
    Commented May 10, 2021 at 3:22
  • \$\begingroup\$ @AndrewLi Each language may only be used on a single answer, regardless of who posts that answer \$\endgroup\$ Commented May 10, 2021 at 15:23
  • \$\begingroup\$ That makes sense, although 74 different languages sounds like a lot, so maybe it would be hard to find "good" languages near the end? I guess that's kind of the point though. I haven't really done any of these challenges so I don't know whether it would get hard to find a language near the end. \$\endgroup\$
    – user101133
    Commented May 10, 2021 at 16:14

Randomized Calculator

Imagine you want to make a random number generator. What if you want it more complex? For this challenge, you should write a program which:

  • Takes 3 inputs:

    • An integer \$a\$
    • An integer \$b\$, such that \$b \ge a\$
    • A string, \$s\$, detailed below, representing one of addition, subtraction, multiplication and division
  • Generates two random integers, \$x, y\$, such that \$a \le x\$ and \$b \ge y\$. The integers should be uniformly random, and chosen independently

  • And, outputs the result of applying \$x\$ and \$y\$ to the mathematical operation detailed by \$s\$

The following strings should be the expected ones to be used for \$s\$:

  • Addition: a, +, plus, p, add
  • Subtraction: s, -, subtract, minus
  • Multiplication: m, *, x, times, t, multiply, ×, ·
  • Division: d, /, divide, :, ÷

One example:

[4, 17, "times"] -> 35

as we generated \$5\$ and \$7\$ from the range \$[4, 17]\$, and multiplied them together.

Shortest code in bytes wins.


  • Any more tags?
  • Anything unclear?
  • More rules to apply?
  • \$\begingroup\$ I'd write "two" instead of "2" not to confuse it with the list item number. \$\endgroup\$
    – Adám
    Commented May 12, 2021 at 17:35
  • \$\begingroup\$ I find it very unclear. Where did that times come from? \$\endgroup\$
    – Adám
    Commented May 12, 2021 at 17:42
  • \$\begingroup\$ I've edited the spec a bit to make it clearer. Feel free to change anything I got wrong or that you dislike \$\endgroup\$ Commented May 12, 2021 at 17:56
  • \$\begingroup\$ @Adám x · y can be rewritten as "x times y". \$\endgroup\$ Commented May 12, 2021 at 18:02
  • \$\begingroup\$ No minus for subtraction? \$\endgroup\$
    – Adám
    Commented May 12, 2021 at 18:33
  • \$\begingroup\$ @MatthewDaniels I have no idea why the fact x · y can be rewritten as "x times y" would cause times in the output. Anyway, with caird's rewrite, it isn't in the output any more. \$\endgroup\$
    – Adám
    Commented May 12, 2021 at 18:35
  • \$\begingroup\$ Is it possible that \$a≤0≤b\$? \$\endgroup\$
    – Adám
    Commented May 12, 2021 at 18:36
  • \$\begingroup\$ @Adám Yes. Both integers can be negative, yet \$b\$ shouldn't be negative if \$a\$ is positive. \$\endgroup\$ Commented May 12, 2021 at 18:42
  • \$\begingroup\$ @Adám No, the mathematical expression. Multiplication can mean times. For example, "6 multiplied by 10" is the same as "6 times 10". \$\endgroup\$ Commented May 12, 2021 at 18:43
  • 2
    \$\begingroup\$ @MatthewDaniels If only one of them can be negative at any one time, you should state so. Also, your statement that \$a≤x\$ and \$b≥y\$ needs clarification. Does this mean that both are unbounded to one side, i.e. \$a≤x≤∞\$ and \$b≥y≥-∞\$? \$\endgroup\$
    – Adám
    Commented May 12, 2021 at 18:45
  • 2
    \$\begingroup\$ What happens if \$b=0\$ and the input requests division? \$\endgroup\$
    – Adám
    Commented May 12, 2021 at 18:46
  • \$\begingroup\$ What happens if the output of division isn't an integer? With what precision should it be printed? \$\endgroup\$ Commented May 13, 2021 at 12:58
  • \$\begingroup\$ Do we need to support all the strings for \$s\$ or may we choose one per category? \$\endgroup\$
    – pajonk
    Commented May 13, 2021 at 19:49

Random Move 2x2 Scrambling


Meta-golf Branch integers without alphanumeric characters

Recently I created a new programming language, Branch (name thanks to caird coinheringaahing). Representing numbers is pretty easy (actually, trivial; you can just enter the number and it will set the value of the current node to that number).

However, until a recent revision, you could only enter one digit, and larger numbers needed to be generated by combining digits with various operations. This led me to think of this challenge - given any integer, you can represent it without needing the digits, actually.

Branch Specifications

Branch operates on a binary tree. Initially, there is just one node with a 0 as its value. Nodes hold long long ints. Any node that's created (unless otherwise specified) has a 0 initially.

Without the digits, here are the relevant instructions (you can also check them out on the wiki page):

Unary Operators

! - logical NOT; set the value to 1 if it's 0 and 0 otherwise
~ - bitwise NOT / complement; flip the bits; this is equivalent to -1 - x
_ - negate; set the value to -x
{ - decrement
} - increment

Binary Operators

+, -, *, :, %, ', <, =, >, &, and | are add, subtract, multiply, integer divide, modulo (keeps the sign of the right argument), exponentiation, strict less than (1 is true, 0 is false), equality, strict greater than, bitwise AND, and bitwise OR, respectively.

Division and modulo give 0 if the right argument is 0. The left and right arguments are the left and right children. Note that Branch will read from STDIN if these are missing, instead of initializing to 0, so for this challenge, you need to ensure that the children are defined before calling a binary operator, because reading from STDIN is not allowed.

The value of evaluating the operation will be stored in the current node.

Pointer Movement

/ - move to the left child (creates it if it does not exist)
\ - move to the right child (^)
^ - move to the parent of the current node (if it doesn't exist, a new node is created, and this node becomes the new node's left child)
? - conditional - if the current value is 0, move to the left child, and otherwise, the right child (creates the required one if absent)


" - set the parent's value to the current value (creates with this node as the left child)
; - set the current value to the parent's value (creates with this node as the left child and with 0 as the value)
@ - swaps the values of the children without changing the structure (creates both nodes with 0 if necessary)
[...] - loop; this works just like in BF; reaching the [ with 0 as the value skips to the matching ], and reaching ] with a non-zero value jumps back to the [

Finally, # outputs the current value as an integer. There are some other I/O commands and other random things but they won't be used for this challenge. I have registers too, but I've chosen to keep them out. Finally, I removed the rotations from this challenge because I didn't feel like dealing with them, even though they probably aren't too complicated especially for anyone who knows how to implement AVL trees.

Challenge Specification

For each integer from 1 to 100, you are to provide a snippet that produces that number as the current value. In other words, your snippet should not have # in it, and when # is appended to it, should output exactly that integer. You cannot do 1## to output 11 (assuming digits were allowed), for example.


For 1, you could do something like /^\^', which creates the children as 0 and then computes 0 ** 0 which is equal to 1.


  • this is a ; the submission with the least number of bytes total for all 100 snippets wins
  • standard loopholes apply
  • good luck and have fun!


  • is this clear enough?
  • is this too unnecessarily complicated; are there any things I could remove (like I did with the rotation operations) that would make this still interesting?
  • is this even interesting?
  • this is not a duplicate



Solve a Quartic Equation

Since I saw the quartic formula and it's a behemoth to solve, your task is to implement it in as few bytes as possible. That's it.

To clarify some concerns, input and output can be as a string representing the equation, a list of numbers, numbers on different lines of STDIN/STDOUT, or a tuple of numbers - anything that represents clearly the four solutions is acceptable, and anything that clearly represents the five inputs is acceptable.

You may assume the equation will always have a real root, and if you choose not to support imaginary roots, you just need to output the real root(s).

On advice from TNB, builtins are now banned The formula for reference:

For a quartic equation \$ax^4 + bx^3 + cx^2 + dx + e = 0\$:

\$x_1, x_2 = \frac{-b}{4a} - S \pm \frac{1}{2}\sqrt[]{4S^2 - 2p + \frac{q}{S}}\$

\$x_3, x_4 = \frac{-b}{4a} + S \pm \frac{1}{2}\sqrt[]{4S^2 - 2p + \frac{q}{S}}\$


\$p = \dfrac{8ac - 3b^2}{8a^2},\$ \$q = \dfrac{b^3 - 4abc + 8a^2d}{8a^3}\$


\$S = \frac{1}{2}\sqrt[]{-\frac{2}{3}p + \frac{1}{3a}\left(Q + \frac{\Delta_0}{Q}\right)},\$ \$Q = \sqrt[3]{\frac{\Delta_1 + \sqrt[]{\Delta_1^2 - 4\Delta_0^3}}{2}}\$

and where:

\$\Delta_0 = c^2 - 3bd + 12ae,\$ \$\Delta_1 = 2c^3 - 9bcd + 27b^2e + 27ad^2 - 72ace\$

I learnt LaTeX just to do all those formulae. I hope you're proud of me. As always, this is , so shortest wins.


  • 1
    \$\begingroup\$ Are we supposed to support non-real roots? \$\endgroup\$
    – Arnauld
    Commented May 17, 2021 at 23:37
  • 1
    \$\begingroup\$ I had gave up to read these crazy formula and I will try some languages with a built-in to solve this... \$\endgroup\$
    – tsh
    Commented May 18, 2021 at 2:28
  • \$\begingroup\$ "quartic equation: ax4+bx3+cx2+dx+e"; should be "ax4+bx3+cx2+dx+e = 0" \$\endgroup\$
    – tsh
    Commented May 18, 2021 at 2:28
  • 1
    \$\begingroup\$ I cannot get the formula work. Had I made some typo? \$\endgroup\$
    – tsh
    Commented May 18, 2021 at 2:41
  • \$\begingroup\$ @Arnauld yes - if your language can support it, it should. \$\endgroup\$ Commented May 18, 2021 at 5:59
  • \$\begingroup\$ I don't think that if your language can support it is a sound criterion, as any TC language can simulate complex numbers (although it can quickly turn into a nightmare with some of them). It may be better to just say "supporting roots with imaginary parts is optional" if that's what you decide. \$\endgroup\$
    – Arnauld
    Commented May 18, 2021 at 6:58
  • \$\begingroup\$ OK - I'll make that optional - but would it be better to make that a bonus or just make it optional \$\endgroup\$ Commented May 18, 2021 at 7:31
  • \$\begingroup\$ @tsh Give me a second to check that \$\endgroup\$ Commented May 18, 2021 at 7:35

Assume a standardized test has \$15\$ multiple choice questions, with \$3\$ options each. A school has some students and wishes for at least one of the students to get \$10\$ correct answers. Since no one in the school knows any math they are going to cheat and tell each student which answers he has to give without knowing what the actual correct answers are.

The problem is to find a number of students \$n\$ such that it is possible to do this and guarantee at least one of the students gets at least \$10\$ correct.

For example one way to do it is with \$n=3\cdot2^{15}-1\$ students, where we do all possible exams with at most two different options, since one of the options appears at most \$5\$ times we can get at least one test with \$10\$ correct solutions.

Another possible \$n\$ is \$a^5\$ where we can get a set of \$a\$ tuples of length \$3\$ that interesect every option of length \$3\$ at least twice ( so basically a solution to the problem with length \$3\$ and at least \$2\$ correct). It seems that the vectors \$(1,1,1),(2,2,2),(3,3,3)\$ along with the 6 permutations work, so \$9^5\$ is also a valid \$n\$.

The score will be \$\frac{1}{n}\$ where \$n\$ is a value for which it is possible to prove a configuration exists.

  • \$\begingroup\$ I'm not sure this is on-topic on our site, since it is not explicitly about code. I think primarily mathematics-based puzzles are allowed on Puzzling. \$\endgroup\$
    – Wezl
    Commented May 26, 2021 at 15:09
  • \$\begingroup\$ You think the best arrangement can be found with math? Without a lot of computation? \$\endgroup\$
    – user103863
    Commented May 26, 2021 at 15:10
  • 3
    \$\begingroup\$ I'll admit that it might be ok to post it here with the tag code-challenge \$\endgroup\$
    – Wezl
    Commented May 26, 2021 at 15:12
  • \$\begingroup\$ It seems like something which can be solved optimally with vertex cover, since 3^15 is reasonably small. \$\endgroup\$ Commented May 28, 2021 at 6:11
  • \$\begingroup\$ Actually it's set cover, not vertex cover. Maybe the best result would be from approximation algorithms, or maybe someone would be able to find a polynomial algorithm for this specific case. \$\endgroup\$ Commented May 28, 2021 at 6:18

Gödel numbering of a string



Compute the generalised XOR (posted)

  • \$\begingroup\$ \$(b - ((p + q) \bmod b)) \bmod b\$ can be simplified to \$-(p+q)\bmod b\$. \$\endgroup\$
    – Bubbler
    Commented May 28, 2021 at 4:00
  • \$\begingroup\$ Yes, I was a bit worried about people getting confused about negative modulo, but I'll make that edit, it's probably easier to understand that way. \$\endgroup\$
    – xavc
    Commented May 28, 2021 at 4:02

Construct a Modulo Multiplication Table

  • \$\begingroup\$ You could change it to be "consider a (n-1) x (n-1) ... and modulo n" (e.g. 5x5, taken modulo 6) so you don't have to ignore the last row and column \$\endgroup\$
    – pxeger
    Commented Jun 2, 2021 at 13:47
  • \$\begingroup\$ @pxeger Thanks. Any suggestions for the title? \$\endgroup\$ Commented Jun 2, 2021 at 13:48
  • \$\begingroup\$ short and simple: "Modulo tables"? \$\endgroup\$
    – pxeger
    Commented Jun 2, 2021 at 14:00
  • \$\begingroup\$ Usually I think of quadrants as axis-aligned.Maybe "Modulo multiplication table", maybe throw in the word partial. \$\endgroup\$
    – qwr
    Commented Jun 2, 2021 at 14:26
  • \$\begingroup\$ Also more test cases just for good measure \$\endgroup\$
    – qwr
    Commented Jun 2, 2021 at 14:26

Salvage My Chemistry Homework


I pulled an all-nighter yesterday doing my Chemistry homework. However, I now realize that was a terrible idea, because my handwriting was too sloppy and now I can’t distinguish the capital letters from the lowercase letters in my chemical formulas! This is a problem, because now the formulas can mean completely different things - for example, co could be cobalt or carbon monoxide. I want to know which of the formulas in my homework are ambiguous in this manner.

Since there are many formulas in the homework, I would like a program to help me so I don’t have to go over them all manually. Also, because the homework is due in an hour, I would like to have the code be as short as possible so I don't have to type as much.


A chemical formula consists of one or more 'units'. Each 'unit' consists of a symbol of an element (the list of valid symbols is given in the input) optionally followed by a number greater than 1. For example, c, co and br2 are valid units (assuming that "c", "co" and "br" are in the list of symbols), while c0 and br2r are not valid units.


The input consists of

  • The list of elements (all letters are lowercase)
  • A chemical formula with all letters in lowercase


Output an integer, the number of ways there to separate the formula into individual units.

Test Cases

Input: ['c', 'o', 'co'], 'co2'
Output: 2 ('c o2', 'co2')

Input: ['c', 'h', 'o', 'ch', 'oh'], 'ch3cooh'
Output: 4 ('c h3 c o o h', 'c h3 c o oh', 'ch3 c o o h', 'ch3 c o oh')

Input: ['c'], 'c1'
Output: 0 (1 is not a valid subscript)

Input: ['a'], 'co2'
Output: 0 ("c" and "co" are not valid symbols)

Input: ['n', 'h', 'o', 'nh', 'no'], 'nh4no3'
Output: 4 ('n h4 n o3', 'n h4 no3', 'nh4 n o3', 'nh4 no3')

Standard loopholes apply. All reasonable input and output methods are allowed. This is , shortest code in each language wins.


  • Would it be better to output each way to split the formula or just the number of ways?
  • Any general wording improvements?
  • Anything I should be more specific about?
  • Suggested tags?
  • Given that l4m2's question has now been posted, should I remove this? (While the challenge is similar, there are some significant differences).

Credit to l4m2 for original idea


Closest Binary Fraction

For this challenge, a binary fraction is a fraction where the denominator is a power of two. Your program (or function) should take a rational number as input, and return the nearest binary fraction with a given denominator.


The first input will consist of a rational number. This can be represented by any of the following:

  • A floating point number, or built-in rational type
  • A fraction, either as a built-in rational or fraction type, or represented as a pair of numbers
  • A decimal string, in any chosen base

The second input is an integer \$d \ge 1\$, representing the denominator of the binary fraction.


Output must be able to represent the exact fraction. This means any of the input formats for fractions are valid, as long as they can reasonably represent any valid outputs.

You may choose if you want to simplify the output. Given the fraction 9 / 19 and the denominator 8, either 4 / 8 or 1 / 2 would be accepted.

Test cases:


This is . Unfinished and also a dupe of a newer challenge of mine

  • \$\begingroup\$ the output part seems.. unfinished? \$\endgroup\$
    – Razetime
    Commented Apr 30, 2021 at 2:47
  • \$\begingroup\$ @Razetime It is, yeah. I was halfway through drafting this when I had to go work on something else, so I just left it here as a reminder to finish it :p \$\endgroup\$ Commented Apr 30, 2021 at 3:21

Is it a Fischer random chess starting board?

  • \$\begingroup\$ Scoring? (code-golf?) Tags? (string chess decision-problem?) \$\endgroup\$
    – pxeger
    Commented Jun 2, 2021 at 14:11
  • \$\begingroup\$ @pxeger yes. I always forget to put them in these posts \$\endgroup\$
    – qwr
    Commented Jun 2, 2021 at 14:12


You are an angry dude who manages the servers, but you are terrible in it. People often text you, and sometimes they ask why are the servers down - you got very annoyed!

Given a non-empty string. If it contains "server" and "down" (capitalization doesn't matter), you infinitely output the >:( face with a newline after. If it doesn't, you only output "Hi" once, because you are busy and angry.


server down -> >:( (infinitely)
server -> Hi
down -> Hi
serverANDLETTERSAFTERTHEWORD down -> >:( (infinitely), as it contains both server and down
Why are your servers down? -> >:( (infinitely)
sErVeR dOwN -> >:( (infinitely)
serverDowN -> >:( (infinitely)
serverd0wn -> Hi


  • This is , so the answer with shortest bytes wins.
  • These loopholes are, obviously, forbidden.
  • Standard code-golf rules apply.
  • Please specify the language you are using and the amount of bytes.
  • It would be great if you would put a link to a sandbox where your code can be ran in action, such as TIO.
  • Explaining your code is very welcomed.

Please comment down below if this is good enough or not, or if it's a duplicate (hope not)
  • 1
    \$\begingroup\$ I don't want to discourage you, but this seems a little trivial and uninteresting to me. Of course, that's just my opinion, and others may enjoy answering this challenge. For the output, would a an infinite list of characters be okay? \$\endgroup\$
    – user
    Commented Jun 6, 2021 at 18:20
  • \$\begingroup\$ It seems like combine two tasks together: 1. test if a string contains both two words or a not; 2. implement a truth machine \$\endgroup\$
    – tsh
    Commented Jun 7, 2021 at 8:21
  • \$\begingroup\$ Damn, that question looks very similar \$\endgroup\$ Commented Jun 7, 2021 at 8:23

Ambiguous Chemical Formula

  • 2
    \$\begingroup\$ This looks like an interesting challenge, but in its current form needs a lot more details (as do most of your sandbox posts - I'd recommend using a question template to make sure you've always included everything). For people who don't know chemistry, it's lacking crucial information: what is the exact syntax of a chemical formula, and how does one know it's ambiguous? \$\endgroup\$
    – pxeger
    Commented Apr 22, 2021 at 16:28
  • 3
    \$\begingroup\$ I also think it would be more interesting if the element list were provided as input. Otherwise most of the actual golfing part of the challenge boils down to compressing the list (or finding a short built-in to output them) \$\endgroup\$
    – pxeger
    Commented Apr 22, 2021 at 16:29
  • \$\begingroup\$ @pxeger Quite unrelated to chemical though, ClI and CLi both don't fell good \$\endgroup\$
    – l4m2
    Commented Apr 22, 2021 at 18:23
  • \$\begingroup\$ I've edited this down to a stub now that it's been posted to save space \$\endgroup\$ Commented Jun 7, 2021 at 1:01

Dr. Lamport's Unfinished Business

  • \$\begingroup\$ Also, I'd love some advice on how to specify what to do for some of the more "exotic" languages. e.g. C and such will obviously just use function-pointers… but I really don't want to alienate any Jelly golfers; those solutions are always my favorite! \$\endgroup\$ Commented May 20, 2021 at 15:49
  • 1
    \$\begingroup\$ Even function-pointers in C wouldn't help afaik, because you can't dynamically construct the function. Maybe you should allowed output the source of G, or alternatively make R take m and pk and just function directly as G. \$\endgroup\$ Commented May 21, 2021 at 7:48
  • \$\begingroup\$ @CommandMaster Thanks for the feedback! Would defining R(digest, pk) work? Such that it gets composed: R(φ(m), pk) -- (this would also align better with the way the original paper defined them.) \$\endgroup\$ Commented May 21, 2021 at 14:08
  • 1
    \$\begingroup\$ I think it would work, and it's also good because it lets programming languages without the concept of a "function" participate \$\endgroup\$ Commented May 21, 2021 at 14:15
  • \$\begingroup\$ @CommandMaster How's the current setup look? I'm certainly worried about accomodating languages without functions. Especially Jelly; I'm not really sure how it works, but I always enjoy those answers a lot! \$\endgroup\$ Commented May 21, 2021 at 14:39
  • \$\begingroup\$ I've edited this down to a stub now that it's been posted to save space \$\endgroup\$ Commented Jun 7, 2021 at 1:02

Write a netquine

There are a lot of online interpreters, for a lot of languages. For example, there's the ubiquitous TIO, but there are also smaller, more specific ones that others have made, such as interpreters for Vyxal, ngn/k, or Grok.

Your goal today is to write a netquine, or a program whose output, when used as a URL, leads to that program in an interpreter for that language. Essentially, if you have a link to your program, and the program outputs that link, it's valid.

For example, say you write a Vyxal program λλλλ. In the Vyxal interpreter, if you press the button to generate a permalink for this program, you get:


However, due to the way that the interpreter processes links, you could also leave out the blank fields:


You can even replace the HTML character codes with the actual characters:


All of these are valid links to the Vyxal program λλλλ, and therefore would all be valid outputs for a netquine.

  • Obviously, Standard loopholes are forbidden.

  • Even though URL shorteners are forbidden by default, shortening a URL, like in the example, is fine, as long as it still leads to the right place.

  • For the purposes of this challenge, a web browser may be considered an "interpreter" for HTML and/or CSS. This means you might be able to do something along these lines.

  • Usual rules apply, as do usual rules.

  • This is , so the shortest answer in bytes wins!


  • Is this question clear enough?

  • Should I change the scoring to accommodate the potential differences in URL length? (lengths of domain names, different ways of generating links, the ability to shorten links, etc.)

  • Any other feedback?

  • This question is quite similar, but it only allows for TIO languages, and it doesn't allow any sort of shortening, even if the link is still valid (there was a comment asking about that), so I would consider it to be related, but not a dupe.

  • \$\begingroup\$ Interesting idea, but you won't get many answers because most online interpreters use an external compression algorithm to shorten the hash (and then base64 it), which is quite lengthy to implement from scratch. Note that the existing answers on the linked challenge all use a gzip or zlib builtin. \$\endgroup\$
    – Bubbler
    Commented Jun 9, 2021 at 23:12
  • \$\begingroup\$ You should provide a list of valid online interpreters, as someone could just make a.com lead to an interpreter for a program in some language that outputs https://www.a.com. Also, please define "in" in the sentence "leads to that program in an interpreter". Does the HTML of that page simply have to contain the program? \$\endgroup\$
    – Makonede
    Commented Jun 9, 2021 at 23:40

Encode USB packets


  • \$\begingroup\$ Is the fifth example correct? Shouldn't 11111111 (8 ones) be JJJJJJKKK? If not, how is 11111111 distinguished from 11111101? (This also applies to your other challenge). \$\endgroup\$ Commented Jun 6, 2021 at 19:33
  • \$\begingroup\$ @Spitemaster yep, you're right - fixed. \$\endgroup\$
    – pxeger
    Commented Jun 9, 2021 at 14:33

A Cat’s Game to Claim


  • \$\begingroup\$ Any catchy name suggestions also appreciated! "Proclaim" rhymes as well, but I can't get it to roll of the tongue. \$\endgroup\$
    – AviFS
    Commented Jun 12, 2021 at 1:15

Build a raw string

In this challenge you will write code which, given a single line string as input, can output the raw version.

Full spec

The input will be a string like ab\n or ab\u0065e\\ or e\'543. These strings should be converted to a raw version which uses the backslashes.

This probably sounds confusing, so here is a more complete explanation.

The most common form of strings used is simply a quote (one of ', " or the backtick), followed by a sequence of unicode characters, then a closing quote which corresponds the opening one. "abc" or 'THIS is a St%ing', for instance. Note that this is not the case in all languages, for instance most golfing languages do not represent strings in this manner.

However, it's not that simple. Backslashes allow for much more complex strings, and their importance in allowing certain characters means a string like 'ab\' is invalid as the backslash "escapes" the quote. Making a backslash appear in a string requires \\ instead.

Also, quotes can be escaped via \', \" or \`. A sequence like \\" should become \" while \"\ is invalid.

The newline and tab are both important, and so most mainstream languages have the \n and \t which are actually 1 character each, representing the newline and the tab, respectively. So \\t\"\n becomes


(note the trailing newline)

To add an extra layer of usability for "exotic" characters, it is possible to use a unicode escape: of the form \uxxxx where each x is one of 0123456789abcdef. This transforms into the unicode character whose codepoint is equal to the base-10 equivalent to the hexadecimal number xxxx. For instance \u0031 becomes 1 because 31 in hexadecimal is 49 in base 10, and 1 has a codepoint of 49.

Your input string may contain any of these escapes, and you may assume that \ is followed only by the backtick or any of \'"tnu. The unicode escape sequence is guaranteed to be valid, and escapes as well.

You should output this string after the transformations described.

Worked example

Input string:


The first three characters remain identical.

\u0035 becomes 5 because 35 in hex -> 53 in base 10, and String.fromCharCode(53) === '5'.

\n\n\t becomes two newlines followed by a tab.

5 remains 5.

\' becomes ': escaped by backslash

e remains e.

\\ becomes \.

54c%& stays the same.

\u0095 is an unprintable with codepoint 149.




(<unprintable> is an actual unprintable character) Note that functions capable of evaluating such strings are disallowed. To be clear, your program must handle the syntax described above, and not any other format.

Other test cases:

Input Output
\'\" '"
\\"\' \"'
\\u0031\u0031\\t \u00311\t
\\\\\\\\\n \\\\<NL>

[<NL> is newline]


  • Duplicate? Couldn't find anything.
  • Any clarifications needed?
  • Better title / tags?
  • \$\begingroup\$ A bit unclear to me: Do we need to handle the string syntax of the answer's implementation language, or the syntax you specify here? If that of our own language, then what if our own language has few special characters? (E.g. in the APL family, it is common that the only unusual character in a string is the quote, which must be doubled.) \$\endgroup\$
    – Adám
    Commented Jun 14, 2021 at 11:54
  • \$\begingroup\$ "eval functions or similar are not allowed." but what constitutes being similar to eval? What about functions in the JSON object of JavaScript? What about library functions to do this? Does APL's built-in ⎕JSON utility function constitute an eval, though the language's real eval is ? \$\endgroup\$
    – Adám
    Commented Jun 14, 2021 at 11:56
  • \$\begingroup\$ @Adám In some calculator questions, the OP (wisely) decides to disallow eval functions. Basically these functions. In essence, from my point of view, if your language is capable of evaluating these strings, then the function that does them is disallowed. However since APL's eval seems different, you can use them. Also in response to the one asking about string syntax, you must handle the one in the question, otherwise it gets a little unfair. \$\endgroup\$
    – user100690
    Commented Jun 14, 2021 at 12:06
  • \$\begingroup\$ Will the input include surrounding quotes? \$\endgroup\$
    – Adám
    Commented Jun 14, 2021 at 12:56
  • \$\begingroup\$ @Adám Nope. (filler) \$\endgroup\$
    – user100690
    Commented Jun 14, 2021 at 13:01
  • \$\begingroup\$ Then do we have to handle unescaped ' and/or "? \$\endgroup\$
    – Adám
    Commented Jun 14, 2021 at 13:03
  • \$\begingroup\$ @Adám You still have to handle them, just not surrounding the entire string. \$\endgroup\$
    – user100690
    Commented Jun 14, 2021 at 13:08
  • \$\begingroup\$ Suggested test cases: '" and \'\" \$\endgroup\$
    – Adám
    Commented Jun 14, 2021 at 13:09
  • \$\begingroup\$ @Adám You know what, the idea of not having surrounding quotes is a little confusing, so I'll remove that rule. That means that your suggested test cases are identical to each other, so I'll add the latter to demonstrate. Also will add about five more cases. \$\endgroup\$
    – user100690
    Commented Jun 14, 2021 at 15:28
  • \$\begingroup\$ "if this string were to be enclosed in quotes in your language and parsed as an expression, no errors should show." makes it sound as if my language matters. \$\endgroup\$
    – Adám
    Commented Jun 15, 2021 at 15:35
  • \$\begingroup\$ @Adám I'll change that \$\endgroup\$
    – user100690
    Commented Jun 15, 2021 at 15:37
  • \$\begingroup\$ Am I allowed to use \n in my code to insert a newline, or is this considered "functions capable of evaluating such"? \$\endgroup\$
    – Adám
    Commented Jun 15, 2021 at 15:58
  • \$\begingroup\$ Let us continue this discussion in chat. \$\endgroup\$
    – user100690
    Commented Jun 15, 2021 at 15:59

COBOL(lite) interpreter.

Your task is to code an interpreter for COBOL. This interpreter should use the free format, and cut a few corners, as long as a few test scripts will run on it.

Notice; here I say interpreter, as that is the general direction of my inclination, however if it may save bytes, a compiler would also count.

Try to:

  • Golf your code as much as possible
  • Remove some parts of COBOL (But ask here first to see if they make sense to remove.
  • Accept both CAPITAL and lowercase


  • Standard Loopholes
  • Don't remove too many parts of COBOL. I think that IDENTIFICATION DIVISION. could be ignored, but DATA DIVISION. is probably necessary.

If there is a thing that you would like to clarify on, ask in the comments. I think that this question still could stand with improvement, before it can be added to the main cg se.

  • 3
    \$\begingroup\$ You need to be a lot more specific with what you want implemented. This can range from syntax requirements to required keywords and function. You need to specify anything and everything yo want in a possible golfed interpreter. \$\endgroup\$
    – Razetime
    Commented Jun 15, 2021 at 10:39
  • \$\begingroup\$ I recommend checking questions tagged under interpreter on the main site for guidance. \$\endgroup\$
    – Razetime
    Commented Jun 15, 2021 at 10:40
  • \$\begingroup\$ @Razetime I didn't have a lot of time to make this post, but that is why it is in the sandbox. I know that I will need to improve it a fair bit, before putting it on the main code golf se \$\endgroup\$
    – smarnav
    Commented Jun 15, 2021 at 23:17

Implement a feature-rich calculator

We have a few many calculator challenges on this site, but none seem to require a complex one with many different features.

This challenge is about emulating my old Casio calculator, except with no digit limit. Features are:

  • basic (start with a single operation, then input the next operation)
  • all clear (AC) which starts a new "calculation". No need for C.
  • errors for dividing by zero (otherwise there should be no error)
  • memory: M to set the memory to current number, MC as an inline expression representing the memory, and M- to get rid of the memory.

This should operate either on STDIN (prompt for commands each time) or in a function (taking in either a list of commands or a newline-separated string with commands).


Your solution should be able to handle floating-point numbers, hence float division should be used regardless of context.

When first run, the calculator will be "ON". It is guaranteed that input syntax is valid.

The chain of commands begins with a number operation number-like structure, where number can be replaced with MC to represent a reference to the memory. For instance 5 * 5 or 6/MC. Whitespace can be ignored or forbidden, that can be your call, but whatever it is you may assume syntax is valid.

Then, if your submission is a full program, it should output the result of that operation, or if a function, append that to the end of a list.

Subsequent operations can either be:

  • M this sets the memory to current number. Memory can only ever hold a single number at a time.
  • AC. Clears the current calculation and resets the number. Memory, however, will still be accessible.
  • M-. (M minus) This clears the memory, and calls to MC will never be given when there is nothing in the memory.
  • operation number where operation is + - * or /, and number is a number which can be replaced with MC.
  • Off. The command Off stops the program, and it is reasonable to assume that no commands will be passed afterwards.
  • - (minus sign) negates current number. Outputs the new number.

Division by zero should trigger an error and restart the calculation. AC, M, MC and M- should output nothing. Memory can be overwritten.

Note that operation number operation number will never be given, and that all operations will be performed on non-negative numbers. (we have the negate operator for negative numbers)

Also note that this challenge is less about parsing / processing a string input and more about responding to different kinds of input.


As a full program, but note that a function will have to take in an array of commands. There is a > before each command, but in your version, it is not required.

> 5*5
> *4
> /200
> /0
ERROR (or some form of ERROR)
> 15*6
> M
> +MC
> AC
> 7-MC
> -
> M-
> +5
> Off

Meta: is it a duplicate? any clarifications needed?

  • \$\begingroup\$ Maybe use the [interactive] tag, and make it clearer that this is less parsing/processing a given string input and more responding to inputs as given \$\endgroup\$ Commented Jun 18, 2021 at 14:16
  • \$\begingroup\$ The "error" should not terminate the program, right? Would it be OK to, on error, print anything that is distinguishable from numeric output (say "X", "Inf", or "NaN"), or print something different across errors (e.g. "Inf" for 1/0, "NaN" for 0/0)? \$\endgroup\$
    – Bubbler
    Commented Jun 25, 2021 at 1:40
  • \$\begingroup\$ @Bubbler Yes, that's fine. You can also output Inf for 1/0 and NaN for 0/0 like you mentioned. \$\endgroup\$
    – user100690
    Commented Jun 25, 2021 at 5:10

KotH - Floating Point Prisoners Dilemma

  • 1
    \$\begingroup\$ Looks intriguing! How does each round work though? So one is coop, zero is defect, but what do the floats in between do? Look forward to hearing! \$\endgroup\$
    – AviFS
    Commented Jun 11, 2021 at 2:33
  • \$\begingroup\$ It uses an equation from the wonderful fellows at math.stackexchange.com to determine what the in-between states should do. I'm bad at explaining, so the equations in my (probably horrible) code are in the play function of the controller class in controller.py \$\endgroup\$
    – 4D4850
    Commented Jun 11, 2021 at 2:46
  • \$\begingroup\$ @4D4850 Would you link to the question if you have it still? \$\endgroup\$
    – math scat
    Commented Jun 11, 2021 at 17:46
  • 1
    \$\begingroup\$ It was actually closed, but here it is: math.stackexchange.com/questions/4152360/… \$\endgroup\$
    – 4D4850
    Commented Jun 11, 2021 at 18:27
  • \$\begingroup\$ Understood it now, good challenge! \$\endgroup\$
    – math scat
    Commented Jun 12, 2021 at 8:39
  • \$\begingroup\$ Should I post the question? \$\endgroup\$
    – 4D4850
    Commented Jun 17, 2021 at 19:08
  • \$\begingroup\$ Posted on Main: codegolf.stackexchange.com/questions/229926/… \$\endgroup\$
    – 4D4850
    Commented Jun 17, 2021 at 22:14
  • \$\begingroup\$ I've edited this down to a stub now that it's been posted to save space \$\endgroup\$ Commented Jun 18, 2021 at 14:33

Encode a Lenguage


Outputting Blum Integers

  • \$\begingroup\$ I'd suggest using standard sequence rules (answers can choose \$n\$th, first \$n\$ or infinite output). I've also edited the challenge a bit, feel free to revert any changes you dislike \$\endgroup\$ Commented Jun 18, 2021 at 14:29
  • \$\begingroup\$ @cairdcoinheringaahing thanks for the suggestion, i'll apply it \$\endgroup\$
    – user100752
    Commented Jun 19, 2021 at 9:14

What's missing

  • \$\begingroup\$ This is probably too easy \$\endgroup\$
    – rak1507
    Commented Mar 22, 2021 at 12:14
  • \$\begingroup\$ Some languages may have built-in Bag / MultiSet / Counter collection type. And a simple - operate or something similar may get correct result. Will you allow answers use such type of values as input / output? \$\endgroup\$
    – tsh
    Commented Mar 23, 2021 at 1:41
  • \$\begingroup\$ @tsh I guess? It doesn't really make a difference for the languages that have creative solutions. It's code-golf, which means answers generally don't get accepted. \$\endgroup\$
    – emanresu A
    Commented Mar 23, 2021 at 8:22
  • \$\begingroup\$ ruby does have array-array, but it wont work for arrays with similar items missing. I feel this is easy, but it can work as a codegolf challenge \$\endgroup\$
    – user100752
    Commented Jun 22, 2021 at 9:24
  • \$\begingroup\$ @EliteDaMyth Honestly, I'm really surprised this doesn't already exist. \$\endgroup\$
    – emanresu A
    Commented Jun 22, 2021 at 9:33
76 77
79 80

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .