# Sandbox for Proposed Challenges

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

## Posting

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.

## Discussion

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
• 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.

## Other

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".

Get the Sandbox Viewer to view the sandbox more easily!

# Volume of a 3d model

In this challenge, you'll take a shape as input, consisting of a number of triangles forming an outer shell. Your task will be to find the volume of the resulting shape.

You can assume the triangles all connect to exactly one other triangle per side, and the surface does not cross over itself. You will not get an input where two separate solids touch only at points or edges.

Test cases and sample implementation coming soon

• I like this one. I think that its got some tricky bits to it, like getting the normals for the triangles and ensuring that they are facing the right way. As far as input format goes, an Ascii stl file may be a good option, as it breaks down the meshes into faces and provides the normals as well. Oct 15, 2021 at 19:36
• is the winding of the input going to be consistent or could it be random? also what is the error bound for the output? Oct 18, 2021 at 3:15
• @donbright Random, I'm thinking. For the output, floating point errors are fine, as long as the calculations would theoretically return the correct result. Oct 18, 2021 at 13:27
• sounds like a good bit of fun but i kind of predict people will ask for some kind of precise bounding on the error like +/- 1 percent or something. Oct 19, 2021 at 2:07
• @donbright The answer could be off by a thousand percent, if I reimplemented the language with arbitrary precision floats and it worked, I'm fine with it. That's way easier for everyone. Answerers don't need to worry about weird floating point tricks, and I don't need to tell them their answer's invalid :) Oct 19, 2021 at 4:15
• i mean the question is how do you know the algorithm works without running it and comparing the result to the known correct value? Oct 20, 2021 at 2:31
• @donbright Probably a mix of trust, and it most likely being close enough to the correct answer that anything other than floating point errors is unlikely Oct 20, 2021 at 2:34

# Converting Pinyin to Zhuyin or vice versa

## Challenge

Pinyin and Zhuyin are systems that are used to help people pronounce characters in Mandarin Chinese. Write a function/program that converts Pinyin to Zhuyin or vice versa (clarify which one you are doing) according to the tables below. You are not required to deal with tones or incorrect inputs (including edge cases such as ḿ(呣), ǹg(嗯), and ê̄(诶/誒)).

### Pinyin to Zhuyin

Pinyin Zhuyin
b
p
m
f
d
t
n (at the beginning)
l
g (at the beginning)
k
h (at the beginning)
j
q
x
zh (except in zhi)
zhi
ch (except in chi)
chi
sh (except in shi)
shi
r (at the beginning)
ri
z (except in zh, zi)
zi
c (except in ch, ci)
ci
s (except in sh, si)
si
a (at the end)
o (except in ao, ou, ong)
e (except in ei, en, eng, er, ie, ue, üe, ye)
e (only in ie, ue, üe, ye)
i (except in ai, ei, ui, iu, iong, yi, zhi, chi, shi, ri, zi, ci, si)
y (except in yong, yi)
yi
u (except in ou, iu, wu, ue and except after j, q, x, y)
w (except in wu)
wu
o (only in ong except in iong, yong)
u (right after j, q, x)
ü
yu
io
yo (only in yong)
ai
ei
i (only in ui)
ao
ou
u (only in iu)
an (except in ang)
ang
en (except in eng)
n (only in in, un except in ing)
eng
ng (only in ing, ong)
er

### Zhuyin to Pinyin

Zhuyin Pinyin
b
p
m
f
d
t
n
l
g
k
h
j
q
x
ㄓ (by itself) zhi
ㄓ (not by itself) zh
ㄔ (by itself) chi
ㄔ (not by itself) ch
ㄕ (by itself) shi
ㄕ (not by itself) sh
ㄖ (by itself) ri
ㄖ (not by itself) r
ㄗ (by itself) zi
ㄗ (not by itself) z
ㄘ (by itself) ci
ㄘ (not by itself) c
ㄙ (by itself) si
ㄙ (not by itself) s
a
o
e
e
ㄧ (at the beginning, not by itself, and not before ㄣ, ㄥ) y
ㄧ (after ㄐ, ㄑ, ㄒ) i
ㄧ (by itself or before ㄣ, ㄥ and at the beginning) yi
ㄨ (not at the beginning) u
ㄨ (at the beginning except by itself) w
ㄨ (by itself) wu
ㄨ (before ㄥ and not at the beginning) o
ㄩ (after ㄐ, ㄑ, ㄒ) u
ㄩ (after ㄋ, ㄌ) ü
ㄩ (by itself or before ㄝ, ㄢ, ㄣ and at the beginning) yu
ㄩ (not at the beginning and before ㄥ) io
ㄩ (at the beginning and before ㄥ) yo
ai
ㄟ (not after ㄨ unless ㄨ is at the beginning) ei
ㄟ (after ㄨ unless ㄨ is at the beginning) i
ao
ㄡ (not after ㄧ unless ㄧ is at the beginning) ou
ㄡ (after ㄧ unless ㄧ is at the beginning) u
an
ang
ㄣ (not after ㄧ, ㄨ, ㄩ unless ㄨ is at the beginning) en
ㄣ (after ㄧ, ㄨ, ㄩ unless ㄨ is at the beginning) n
ㄥ (not after ㄧ, ㄨ, ㄩ unless ㄨ is at the beginning) eng
ㄥ (after ㄧ, ㄨ, ㄩ unless ㄨ is at the beginning) ng
er

This is code-golf, so the answer with the least bytes wins.

## Test Cases

Pinyin Zhuyin
chuang ㄔㄨㄤ
xue ㄒㄩㄝ
diu ㄉㄧㄡ
juan ㄐㄩㄢ
ri
song ㄙㄨㄥ
ㄌㄩ
qiong ㄑㄩㄥ
zhen ㄓㄣ
huo ㄏㄨㄛ
ying ㄧㄥ

• Am I required to support single characters or a word / sentence? Also, there are some edge cases as I know, for example, ḿ(呣), ǹg(嗯), ê̄(诶/誒). Would these be excluded from testcases? May I assume no erhua (儿化/兒化) would be applied?
– tsh
Oct 12, 2021 at 6:44
• There are far more rules than testcases. I would suggest to add more testcases as many rules are not ever touched by any testcases here.
– tsh
Oct 12, 2021 at 6:54
• @tsh Single characters. The edge cases would not be required to check for as inputs. No erhua. I will try to add some more testcases to cover the other rules. Oct 12, 2021 at 11:19
• Suggest a whole list, it's likely just 300+ possible inputs
– l4m2
Oct 12, 2021 at 18:13
• The number of rules makes this an intimidating task to write and golf. Consider limited to a simpler subset of rules or situations.
– xnor
Oct 13, 2021 at 7:12
• @xnor It's not actually as many rules as it looks like. A simple regex can be used for most of them. Oct 13, 2021 at 21:41

# Is This Scrabble Board Valid?

## Leave ABACABA on the tape

Note that will be removed post sandboxing: This challenge is Brainfuck-specific, but I hope that its contents make the reason why sufficiently clear.

Write a brainfuck program which leaves the following sequence on the tape:

0 1 0 2 0 1 0 3 0 1 0 2 0 1 0 4 0 1 0 2 0 1 0 3 0 1 0 2 0 1 0 ...


This sequence may be familiar to some as ABACABADABACABA... or A007814.

Assume an implementation of BF with an endless tape and arbitrarily large (but not arbitrarily small) integers.

You should link to a visualizer to prove that your program works as you say it does, but if this isn't fast enough to witness the first few (say 4) numbers in ABACABA you'll have to explain it yourself.

This is code-golf, so the shortest program operating within these rules wins. Have fun!

• Because a BF program would likely do destructive edits to the previous terms or add scratch data to the end while advancing the sequence, I'd propose a more rigorous definition: "Write a BF program where, given any prefix of the ABACABA sequence, running the program for some finite number of steps will give the pattern at the start of the tape." Nov 18, 2021 at 1:32

# Light-Cycle KotH

• I'd recommend removing all bots that crash in the same turn. Basing it off of external factors like submission dates is a bit unfair. Sep 13, 2021 at 17:04
• My justification for removing only 1 per turn is that it simplifies the logic of generating a leaderboard and removes some edge cases, otherwise things like 3-way ties for first place might be possible if all the bots crash at the same time. Sep 13, 2021 at 20:51
• I feel like biasing the rules against newer submissions is fair. After all, new submissions inherently have the advantage that they're able to see the older submissions and can strategize around these existing submissions. Sep 13, 2021 at 20:55
• The issue is that the oldest submissions functionally move first, meaning that being the first bot posted is a significant advantage. What about edits? If a bot is changed, does it drop to the bottom? I agree that removing all bots which crash is the right call. Sep 14, 2021 at 18:36
• Hmm... I was going to disallow edits, so that anyone who wanted to update their bot must instead post it as a new bot. @Spitemaster Are edits typically allowed for KotH submission? Sep 14, 2021 at 20:27
• Frequently; not always. But you've still got the problem of earlier entries effectively moving first. If you really want to do it this way, it doesn't make sense to have simultaneous movement (because it's not really simultaneous). Sep 14, 2021 at 20:34
• Ok, that seems fair, I will update post to allow for simultaneous movement Sep 14, 2021 at 20:49
• If I were you, I'd consider sizing the arena based on number of bots. Sep 14, 2021 at 20:56
• That seems like a reasonable suggestion, what kind of scaling do you think would be good? I'm thinking maybe something like a square with side-length 2n+6, for n players. Sep 14, 2021 at 21:02

# Randomly capitalize half of a string

• Will a string of length 0 ever be an input? Jun 15, 2017 at 12:26
• @dzaima no, clarified by saying length will always be positive Jun 15, 2017 at 13:57
• Change "positive" to "non-zero"? You can't have a negative-length string, last time I checked... Dec 1, 2021 at 18:15

# Write a number in overflowed binary

• Maybe define a overflowed binary number a binary number where one or more of it's digits goes over 1? Dec 3, 2021 at 17:21

# Solve an Inglenook Sidings Puzzle

Posted! After about 2 weeks in Sandbox

• @Bubbler specifically model railroading. The puzzle was made to create operational interest on small layouts, since it only needs 2 switches and 4 pieces of relatively short track Nov 25, 2021 at 4:05
• So this challenge proposal has been in here for just about a week now; are there any flaws in this? I don't want to post this to the main site and get feedback that should've been caught in meta Dec 1, 2021 at 16:11

# Worst time complexity in under 100 bytes

Time complexity, typically represented in Big O notation, represents how long a program will typically take to run given some input(s), ignoring constants.

Your task is to do one of the following things, with the worst time complexity possible:

• Sort an array of integers
• Find duplicates in an array
• Find longest strictly increasing slice of an array of integers

All of the tasks involve taking one input, an array of items, in any reasonable format, and returning an array. If your language supports mutable array data types, this is an allowed output format. Assume all items in the arrays will be (not necessarily positive) integers.

If you choose sorting: You may choose to sort the array by minimum or maximum.

If you choose listing duplicates: You may include a duplicate item any number of times in the output; [1, 2, 2, 3, 4] could result in [2, 4], [2, 2, 4], or even [2, 4, 4, 4].

If you choose longest strictly increasing slice: Duplicate items do not count as increasing, so [1, 2, 2, 4] is not strictly increasing. The items do not have to increase by a steady amount; [-1, 4, 14, 16, 17] is strictly increasing.

Rules:

Your program must be 100 bytes or less. Your program should terminate in a finite amount of time. You can assume your program will never run out of memory, and it does not have to terminate before the heat death of the universe.

This is a . The winner will be based on the average time complexity, with slower being better, followed by the best case and then worst case for ties.

• Unfortunately, this answer broke all "irreducible" challenges. You can execute (almost) arbitrary code unrelated to the task without breaking the "irreducible" requirement. Apr 22, 2021 at 0:16
• @Bubbler Hmm, and I don't think irreducible is a sensible requirement for this either. It definitely makes more sense with bytes than time, along with pristine. I'll have to think about some creative limitations. Maybe unique bytes only? Apr 22, 2021 at 0:22
• Now this is somewhat too close to bignum computation challenge, since all the biggest numbers are actually a fast-growing function applied to some number. They can be trivially converted to take the length of the input, and then used in the algorithm in some way (or just discarded). Dec 16, 2021 at 8:32
• How about this: Choose a decision problem, and write code that solves it, within 100 bytes (or use a partially ordered score instead of a byte limit). Answers are compared based on the minimal time complexity of the problem, not the implementation. So if someone solves an EXPTIME-hard problem, they beat whoever solves a problem in P. This solves the problem of people doing useless calculations, since it doesn't help them. Writing a sorting function that takes exponential time is not in any way better than just doing a sort in O(nlogn) time. Dec 16, 2021 at 11:25
• @AnttiP That could be cool, but it sort of goes against what I was going for (ridiculously slow sorting algorithms). Maybe a separate challenge idea? Dec 16, 2021 at 14:27

# Nth FizzBuzz Number

• Maybe allow any different 4 distinct inputs for Fizz, Buzz, FizzBuzz and Number? Dec 16, 2021 at 11:48

# Light it up

• Maybe you can fill empty cells by some characters like . in your examples and testcases. Or it could be confusing: L.#. is falsy but L.# is truthy, but it is hard to see the difference.
– tsh
Nov 2, 2021 at 1:53
• @tsh Ok, thanks! Nov 2, 2021 at 2:02
• "some squares are walls, some are empty, and some are lights". Since there are testcases where only empty cell is there, will there be any testcases like ####?
– tsh
Nov 2, 2021 at 5:23
• @tsh Yes, see the fourth truthy one. I'll be more explicit that some may not occur at all. Nov 2, 2021 at 6:13

# Print □□Square□□ Numbers

Your task is to write a program or function that accepts an integer as input/argument and prints/returns all square numbers from 0 up to but not including n².

But the numbers should not just be perfect squares in the mathematical sense. They should be square in every sense. That is, the digits should

• • occupy a square space, 5 lines by 5 columns (including separating space)
• • form right angles at their joints
• • be formed entirely from □ and space characters

Actually, the digits must be shaped exactly like these:

   □ □□□□ □□□□ □  □ □□□□ □□□□ □□□□ □□□□ □□□□ □□□□
□    □    □ □  □ □    □       □ □  □ □  □ □  □
□ □□□□ □□□□ □□□□ □□□□ □□□□    □ □□□□ □□□□ □  □
□ □       □    □    □ □  □    □ □  □    □ □  □
□ □□□□ □□□□    □ □□□□ □□□□    □ □□□□ □□□□ □□□□


Note the single column of space between each digit. Spaces at the end of each line are optional. (The three empty columns of spaces on the left side of the digit 1 are not optional.)

Each square number shall be printed on exactly 5 lines using these digits, and between each of these numbers shall be a single line containing no non-whitespace characters. You may optionally include extra blank lines at the beginning or end of the output.

Standard loopholes etc. Shortest solution in bytes is the coolest of beans.

Example Output (given the input 5):

□□□□
□  □
□  □
□  □
□□□□

□
□
□
□
□

□  □
□  □
□□□□
□
□

□□□□
□  □
□□□□
□
□□□□

□ □□□□
□ □
□ □□□□
□ □  □
□ □□□□


(Note for sandbox: I know this is a good challenge because I had fun solving it myself. But I am worried there is another challenge I haven't seen that is too similar. Please let me know. I'll abandon it if so.)

• Can't find any dupes on this search so it is probably clear. Jan 7 at 4:45
• Closely related Jan 7 at 7:58
• @pxeger yeah that's probably similar enough not to post this Jan 7 at 17:37

## Remove consistently dependent smaller integers

• If lists can be empty I would add an example where one is empty, if they cannot I would make that explicit in the text. Otherwise this seems fine +1.
– Wheat Wizard Mod
Jan 6 at 14:20
• @WheatWizard i will explicitly specify. Thank you:) Jan 6 at 14:23

# Expand a Rubik's Cube Commutator

• What do you mean by "expand" the commutator? Also, 3x3x3*, a 3x3 would be a rubik's square :) Jan 11 at 15:12
• @thejonymyster The common names for Rubik's cubes are by the size of a face since they're usually cubes, so we just call them "3x3" for a 3x3x3 cube, etc. Only in cuboids like the 3x3x4 cuboid actually have the 3rd dimension "Expanding" the commutator == Listing out all the moves performed in the commutator Jan 11 at 19:59
• ahh, that makes sense, for both parts. +1 Jan 11 at 20:03
• "Each part of the commutator can be a separate value" - I see this is to make IO more flexible than flat string to flat string, which is good, but I would go further and allow the moves themselves be separate values in each part, and allow a list of moves as the output in order to focus on the challenge itself. This would allow, for example, [["F'", "U2", "R"], ["D", "B2"]] -> ["F'", "U2", "R", "D", "B2", "R'", "U2", "F", "B2", "D'"]. Jan 11 at 23:07
• I couldn't resist and just gave it a go in Jelly and got a 15 byte solution (assuming IO is further relaxed as I suggested, which I believe you will do given your current relaxation). This is a good challenge IMO. Jan 11 at 23:20

# Will the tower balance?

You are given as input a tower made of bars of unit height, and your task is to decide if the tower is stable. Here is an ascii art drawing of a tower:

 #
####
# ####
#####


For extra clarity here is the same tower but with the different bars in different characters:

 A
BBBB
C DDDD
EEEEE


The bars are rigid, but they are not connected to each other. Even though the bars are not connected, they stay still under the influence of gravity. Here however is a tower that is not stable:

      B
CCCCCCCC
D
EEE
FFFFFFFF


In this tower, under the influence of gravity, the top bar will fall to the right.

The following tower is metastable:

AA
B


The center of mass of the A-bar lies on top of the edge of the B-bar. In this kind of situation the tower is considered unstable, since even a small perturbation will cause it to fall eventually.

# Input/output format

The input format is an ascii drawing of the tower like so:

 ###
#
### #


In this picture there are 4 bars. It is guranteed that all bars are on top of another bar or on top of the ground and that every row has at least one bar. You can use a different printable ascii character instead of #. You can also take a 2d array instead of a string and use two distinct values for # and  . In that case please use simple values, that don't encode extra information (standard loopholes prohibited).

Output two distinct values for STABLE and UNSTABLE.

# Test cases

#


STABLE

###
#
##
#


UNSTABLE

  ###
###
###


UNSTABLE (metastable)

#
#     ######
####    ##
#      ##


STABLE

###
#
#####
#


STABLE

 #
#####
#


UNSTABLE

######  #
#  #   #
### #####
#   #
#####
#


STABLE

• The rules do not actually specify what makes a tower stable. The stable test cases use balancing methods not stated anywhere, and the rules themselves just seem to be more examples. As a non physicist, "use gravity" isn't enough information IMO. This is a cool idea though and +1 once that's fixed Jan 17 at 13:49
• Just highlighting the bars on their own would be interesting IMO Jan 17 at 18:36

# Shrink ASCII art

• convert like ---, 3 to [---, 3]? Dec 26, 2021 at 0:48

## Is this continuous terrain? Part II

• i like it emanresu A! Jan 19 at 8:50

# Only one from each set

• "There are no gaps in the numbers " does it means that the input flattened must contain all the numbers [1..n] where n is the maximum number in it? Jan 23 at 10:31
• @AZTECCO Yes, exactly Jan 23 at 10:32
• Ok, i think you should explain it, careful.. there are some test cases non valid. I think you may also specify that inner lists are sorted (if it's so I guess) Jan 23 at 10:40

Shanghai ascii game sticks

Posted

• Looks great, ready to post Jan 21 at 10:38
• @ThisFieldIsRequired thanks, I still got something to tweak.. I'm gonna take some time Jan 21 at 12:32
• How are the last two testcases possible? Jan 22 at 19:29
• @emanresu A the last test case is an edge case were 4 sticks are all bounded and one sits by itself and satisfy the one and only one stick removable condition, you are not required to remove all sticks but just the first Jan 22 at 20:11

# Highlight a Wordle guess

• confused to be honest . maybeeee abit too hard? Jan 17 at 9:57
• @DialFrost Can you be more specific? What part are you confused about? Jan 17 at 9:58
• er mostly about the highlighting value Jan 17 at 10:00
• @DialFrost do you mean: 1) you don't understand when to highlight the letters in which colour; or 2) you don't understand how the output values used for highlighting can be chosen? Or something else? Jan 17 at 10:01
• both i dont understand Jan 17 at 10:01
• @DialFrost without some more details on what you're missing, I can't help you to understand or clarify the description. What bits you do you understand? Jan 17 at 10:05
• pretty much none i just meant i dont understand the hilighting value and how it works the most Jan 17 at 10:06

# Reversed Multiple Pair

• maybe give an example and a step by step of evaluating if it is reversed multiple? Jan 13 at 20:19
• @thejonymyster Done Jan 13 at 20:29
• really simple, but it is clearly specified. seems like a decent easy challenge. To make it slightly more difficult you can make this a challenge of finding all reversed multiple pairs under a given limit. Jan 14 at 3:35
• Jan 14 at 15:31
• it's your choice whether that change makes it more interesting or whether it is an unnecessary burden. Jan 14 at 15:55

# Happy new year string builder

Posted here.

• The regex should probably be /^(have a )?happy new year( to you)?!*\$/i (removed unnecessary grouping, added string start and end match, and the i tag means the search is case insensitive by default.) Feb 7 at 23:12
• @hakr14 thanks, editing the answer. Feb 8 at 6:07

# The Con Man

The bots start with a balance of 100 points each. Each round is a 1v1 between two bots. One bot is the Proposer and the other is the Receiver.

P provides R with two numbers: think of it as a loan and repayment with interest. For example, P could propose (50, 60) which means that P wants to swap 50 points for 60 points with R. P also decides whether or to scam R. If R accepts, P can scam R by not upholding their end of the deal and instead taking the 50 points outright.

The twist is, R can see the outcomes of past transactions of P to determine whether or not to trust P and accept the offer.

The format of the tournament is that of a round robin where every bot will play P and R the same number of times against all opponents, in an unspecified order.

Whichever bot ends up with the most points wins.

The language of this challenge is JS.

Format (in TypeScript):

type Bot = {
R(
offer: [number, number], // loan, repay
opponentBalance: number,
pastTransactions: [number, number, number][] // loan, repay, outcome (0 -> accept, 1 -> reject, 2 -> scam)
): boolean,
P(
opponentBalance: number,
pastTransactions: [number, number, number][]
): [number, number, boolean] // [loan, repay, scam]
}


## Meta

• Does this make for diverse enough strategies to be worthwhile?
• Should more or less information about the opponent be supplied to the players?
• And if the bot runs out of money, does it die or can it take a loan? It can't give out loans obviously right? Feb 15 at 8:41
• @ophact I think it should die since no reasonable strategy would accept a deal with a bot with no money. Feb 16 at 2:16

# Golfing Coins (suggested rewrite)

The challenge is to write a program that begins with a board like this:

O O X
O O X
O O X


The O's are coins. X's are empty.

## Rules

Every round you will uniformly randomly choose a coin and a cardinal direction. You will move that coin 1 spot in that direction, if there is an empty space there. Or in other words, moves must satisfy the following rules:

• The coins can only move up, down, left or right 1 spot.
• Coins cannot move outside the board
• Coins cannot overlap

This process should be repeated until every coin has moved into each spot on the board. You should output the state of the board after every move.

This is so shortest code in each language wins.

• Still don't quite understand what is uniformly randomly choose here mean. For example, the board is OXO/XOX/OOO. If we first choose one coin, and then choose its direction, it will have 1/5 chance to chose the O in the middle. But if we list all possible moves and choose one from them, the middle one should have a 1/3 chance.
– tsh
Feb 21 at 6:20

# Posted here

• What is the order each rules applied? For example, for rules "11=12", "12=21", "22=3". If input is "1112", should it be "1112 -> 1212 -> 2121" or "1112 -> 1221 -> 131" or "1122 -> 1222 -> 123"?
– tsh
Feb 22 at 7:58
• All of them. See the original specification for Shue in the linked challenge, or the interpreter. Feb 22 at 15:11
• As challenges should be self-contained, I suggest you add the mathematical definition from my post (and maybe an informal explanation of how the rules are applied non-deterministically) Feb 22 at 16:46