Ctrl+P again to print, arrows/tab to navigate results, enter to confirm

    (WIP - Improvements to wording, formatting, and information appreciated)

    The goal of this page is to document the constraints of input holes on code.golf, including some details that may not be listed in the hole descriptions themselves. This page is not intended to list tips on solving holes, as the Hole-specific tips page already exists to do that.

    On this page, [x..y] means the inclusive range from x to y.

    ARGC - This page documents argc, the number of arguments for each hole. Although general constraints to holes rarely, if ever change, it is not uncommon for the number of arguments to a hole to sometimes be changed. As a result, solutions which hardcode argc may break over time. If you are editing a hole to add additional testcases, consider breaking it into multiple runs with the same argc as previous in order to avoid needlessly breaking solutions that hardcode argc.

    RUNS - Some holes are "run" multiple times on different sets of inputs. What this means is that your code will be run independently on each set of inputs, and only be considered "passing" if it succeeds on all runs. Since these runs are completely separate, the number of runs has no direct effect on how your solution works, but it may still be useful to know what each run does. For example, the arguments of the hole "Emojify" are 25 ASCII emoticons. The hole is run 3 times: once with all 25 emoticons, and 2 more times with those inputs split into 2 groups of size 12 & 13.

    Arabic to Roman

    argc = 2000

    Each argument is an integer in [1..3999]. Each number in this range appears once, split into 2 runs of 2000 arguments each.

    Arrows

    argc in [27, 30..90]

    Each argument is a Unicode arrow pointing in 1 of 8 directions, or in no direction. The hole consists of 5 runs:

    Billiards

    argc = 64

    Each argument is 2 space separated integers, w and h. There are 164 possible unique arguments, consisting of all combinations of w in [1..8] and h in [1..20], plus 5 25, 10 5, 10 15, and 10 25.

    brainfuck

    argc = 12

    Each argument is a program in the brainfuck programming language which outputs a line of printable ASCII followed by a newline character. Each program:

     #3456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz
    

    Card Number Validation

    argc = 106

    Each argument contains 16 numerical digits in the format 0000 0000 0000 0000.

    CSS Colors

    argc = 148

    Each argument is the name of a color. The arguments form a full permutation of the 148 possible CSS color names.

    Day of Week

    argc = 687

    Each argument represents a date between 1583-01-01 and 9999-12-31 in YYYY-MM-DD format. Specifically, each year in [1583..2082] and in [9901..9999] is represented, plus each year in that range which begins a century. Every weekday is guaranteed to be represented at least once.

    DFA Simulator

    argc = 121

    Each argument represents a DFA as a table with alphabet characters as columns and states as rows, followed by an input to the DFA surrounded by quotes.

    Each DFA has between [1..8] states. Exactly one state will be marked as the start state by a preceding >. 0 or more states will be marked as accept states by a leading F, and there is guaranteed to be an argument with no accept states.

    Each DFA has [1..26] alphabet characters.

    Each input string has [0..51] characters.

    Emojify

    argc in [12, 13, 25]

    Each argument is one of 25 ASCII emoticon. The first run has 25 arguments, forming a full permutation. The 2nd and 3rd arguments form a full permutation split into 2 runs of size 12 and 13.

    Forsyth–Edwards Notation

    argc = 5

    Each argument is one of the following strings representing a chess game. Four of the possibilities are fixed:

    The fifth possibility is a string of the form

    where a..h form a permutation of ["2k1N3", "7r", "8", "2B5", "3rb3", "4n3", "1R6", "4K3"].

    Fractions

    argc = 128

    Each argument is a fraction in form num/denom, where num is in [0..250] and denom is in [1..250].

    Game of Life

    argc = 1

    The input is a 32 x 32 grid of .s and #, of the following form, where a ? represents a random choice of either character: (Note that the outer perimeter consists only of .'s.

    ................................
    ..##.#####..###......#.##??????.
    .#......#.###..#.###..#.#??????.
    .....#..######.#..##.##.#??????.
    .#......#.###..#.###..#.#??????.
    .####.##......#.##..#..#.??????.
    .#......#.###..#.###..#.#??????.
    .....#..######.#..##.##.#??????.
    ....##...###.#.##.#####..??????.
    .##...#.#..##.##.#.#....#?????#.
    ..######.#...##.#...##.#.?????#.
    .####.##......#.##..#..#.?????#.
    .##.#.#....#..####.##....??????.
    .#.#...##.#.#....##...###??????.
    ..######.#...##.#...##.#.??????.
    .####.##......#.##..#..#.??????.
    .#.##..#..#.....###.#.##.??????.
    ..##.#####..###......#.##??????.
    .#......#.###..#.###..#.#??????.
    .##..#..#.#.#.##...######??????.
    ..###..#.###.#...##.#...#??????.
    ..#.#....##..#.#.####..##??????.
    ..###..#.###...#..####.##??????.
    .#.#.####..#######.#..##.??????.
    ..###..#.###.#...##.#...#??????.
    ..#.#....##..#.#.####..##??????.
    ....#.#..#...#.#####...#.??????.
    ..##...########..#..#.#.#??????.
    .#...##.#...#.###..#.###.??????.
    .??????????????????????????????.
    .??????????????????????###?????.
    ................................
    

    Hexdump

    argc = 7

    The arguments are a random shuffling of the 7 fixed test cases.

    Intersection

    argc in [107..276]

    Each argument is eight space-separated integers, like x1 y1 w1 h1 x2 y2 w2 h2.

    x1, y1, x2, and y2 are in [0..100].

    w1, h1, w2, and h2 are in [1..50].

    ISBN

    argc = 100

    Each argument is 10 numerical digits and 3 dashes, arranged in any of the following forms (where 0 can represent any digit):

    Jacobi Symbol

    argc = 98

    Each argument consists of 2 space-separated integers, a and n. a is in [0..(1<<53)] and b is an odd number in [1..(1<<53)]

    Levenshtein Distance

    argc = 20

    Each argument is a pair of space-separated lowercases words, each with [1..16] characters.

    Lucky Tickets

    argc = 20

    Each argument is a pair of space-separated numbers like a b.

    a is in [2..14].

    b is an even number in [2..16].

    Mahjong

    (TO-DO)

    Maze

    argc = 1

    There are 5 runs, each with a single 51x51 newline-separated maze (total length of input = 2651). The outside border of the maze is always solid walls (#). Mazes are designed with only one-char wide paths and walls (ie. 2x2 squares of solid walls or 2x2 blank squares do not occur).

    Medal Tally

    argc = 223

    Each argument is a space-separated list of [1..10] integers, each in [1..98].

    Morse Decoder

    argc = 1 See Morse Encoder below, but encoded as Morse code.

    Morse Encoder

    argc = 1

    A string is created containing 9 space-separated words: "BUD", "FOR", "JIGS", "NYMPH", "QUICK", "VEX", "WALTZ", the 10 numerical digits randomly arranged into a word, and the 26 uppercase letters randomly arranged into a word. This 72-character string is split into 2 parts of length 36, each of which as passed as the sole argument for a run.

    Musical Chords

    argc = 363

    Each argument is a valid triad consisting of 3 space-separated pitch class names. Of the 372 possible triads, 9 are chosen at random to be dropped, and the remaining 363 are passed as arguments.

    N Queens

    (TO-DO)

    Ordinal Numbers

    (TO-DO)

    PalindromemordnilaP

    (TO-DO)

    Pangram Grep

    argc = 76

    Each argument is a string consisting of up to 79 printable ASCII characters [0x20..0x7e] (" ".."~"). All arguments in the first run contain at least one non-letter character, while at least one argument in the second run is composed of only letters.

    Poker

    argc = 37

    Each argument is a hand of 5 poker cards [0x1f0al..0x1f0de] ("🂡".."🃞").

    Proximity Grid

    (TODO)

    QR Decoder

    argc = 1

    The argument is a QR code which encodes 17 ASCII characters [0x21..0x7e] ("!".."~").

    Repeating Decimals

    (TO-DO)

    Reverse Polish Notation

    argc = 20

    Each argument is [1..253] characters long. Each argument is a space-separated list of n integers and o operators, where n is in [1..32] and o = n - 1. Each integer is in [0..32676]. Operators can be any of +, -, /, *.

    Reversi

    (TO-DO)

    Rock-paper-scissors-Spock-lizard

    argc in [12, 13, 25]

    Each argument is a unique repeated 2-permutation of the allowed plays. The first run consists of all 25 such permutations, the 2nd and 3rd runs consist of those permutations split into 2 runs of 12 and 13.

    Roman to Arabic

    argc = 2000

    Each argument is an uppercase Roman representation of an integer in [1..3999]. Each number in this range appears once, split into 2 runs of 2000 arguments each.

    ROT13

    (TO-DO)

    Seven Segment

    argc = 1

    The argument contains 2 of each numerical digit.

    SI Units

    (TO-DO)

    Spelling Numbers

    argc = 1001

    Each argument is a number in [0..1000]. The arguments form a full permutation of these numbers.

    Star Wars Opening Crawl

    argc = 9

    Each argument consists of 2 space separated integers i and w, followed by the opening text crawls to one of the 9 Star Wars movies.

    i is in [6..11]. w is in [14..49].

    Sudoku

    argc = 9

    Each argument is a row of an unsolved Sudoku board, with "_" representing unsolved cells. There are at most 50 unsolved cells.

    Sudoku (Fill-in)

    argc = 1

    The input is a Unicode formatted Sudoku board with " " in unsolved cells. There are at most 50 unsolved cells.

    Ten-pin Bowling

    argc = 40

    Each argument represents ten space-separated frames of bowling, and is right-padded with spaces if necessary to be 30 characters long.

    Tic-tac-toe

    (TODO)

    Time Distance

    argc = 321

    Each argument is an integer in [-31535999999..31535999999]

    Transpose Sentence

    (TO-DO)

    United States

    argc in [25, 26, 51]

    Each argument is a unique one of the 50 U.S. states plus District of Columbia. The first run is a full permutation of these 51 possibilities, the 2nd and 3rd runs consist of those permutations split into 2 runs of 25 and 26.

    Zeckendorf Representation

    (TO-DO)

    Zodiac Signs

    (TO-DO)