Questions tagged [test-battery]

A problem whose scoring criterion involves running the output of a program through a large number of test cases.

Filter by
Sorted by
Tagged with
17 votes
23 answers
3k views

Meta-cat program

Write a program or function that takes input and outputs/returns a full program (in the same language) that outputs said input. Note that the input may contain any printable ASCII character or newline ...
Dadsdy's user avatar
  • 2,035
5 votes
1 answer
185 views

BitCycle Metagolf

Background BitCycle is a two-dimensional Turing-complete programming language involves moving bits around a playfield. Because I am too lazy to write BitCycle programs myself, you will be writing a ...
Aiden Chow's user avatar
  • 12.7k
6 votes
2 answers
291 views

Generate Matching Regexes

Write a program that takes two lists of strings and generates a javascript regex that fully matches all the strings in the first list and matches none of the strings in the second list. To be specific ...
user197974's user avatar
  • 1,161
9 votes
0 answers
372 views

Chess Squad March

Find the moves that bring a chess squad to a given destination. You control a chess squad consisting of a king and several other pieces, on a larger chess board. Your army is placed so that no piece ...
Valentin Brasso's user avatar
13 votes
7 answers
550 views

Splinter metagolf

The language Splinter is an esoteric programming language where data is stored in 'splinters'. There are three different types of syntax: Simple character output: ...
emanresu A's user avatar
  • 35.6k
5 votes
2 answers
1k views

Generate the shortest regex to match these but not those [closed]

Challenge Given two lists of strings where each string is of length 50 and each list is also of length 50 generate the shortest regex you can that fully matches all the strings in the first list and ...
user197974's user avatar
  • 1,161
18 votes
1 answer
676 views

Golfing Expressions

We can write mathematical expressions using the standard math operators (,),+,...
Jay's user avatar
  • 281
20 votes
6 answers
2k views

The 1+ Metagolf Challenge

I'm letting this one out of the sandbox. Hopefully it is well-written and make sense, feel free to improve. So in order to make 1+ more popular (and ease the creation of golfed 1+ text-printing ...
TwilightSparkle's user avatar
12 votes
4 answers
2k views

Who's that pokemon (based on its etymology)?

As we all know, most Pokemon are created by combining some English (or Japanese) words; these words are the Pokemon's "etymology." For example, "charmander" is "char" and "salamander" put together. ...
soktinpk's user avatar
  • 4,472
6 votes
2 answers
327 views

2D interpolation

Given required values for an expression with 2 variables, output a short expression which fulfill these values Input You may take the input in any reasonable format, e.g. ...
Command Master's user avatar
17 votes
3 answers
536 views

Bridge the Gaps

Given a black and white image with a white background and a set of black dots, paint a set of white pixels red, such that there is a path between each pair of black pixels. Details A path is a set ...
flawr's user avatar
  • 43.7k
10 votes
0 answers
320 views

Captcha Capture [closed]

Captchas aren't meant to be machine-readable, and that's terrible. It is time to end this obvious bout of unfounded hatred for machines just trying to let you know about great deals on ṗḧ@ṛḿ4ćëüẗ1ċäḷṡ ...
Twilight Sparkle's user avatar
13 votes
5 answers
2k views

The Onion, or Not The Onion?

The Onion (warning: many articles are NSFW) is a satirical news organization that parodies traditional news media. In 2014, The Onion launched ClickHole (warning: also frequently NSFW), a satirical ...
user avatar
29 votes
4 answers
1k views

Where's Blackhat?

Challenge Write code which, given an image of a panel from a random xkcd comic, returns a truthy value if Blackhat is in the comic or falsey if not. Who is Blackhat? Blackhat is the unofficial name ...
Beta Decay's user avatar
  • 23.3k
38 votes
3 answers
1k views

Build a golfing language with me

A lot of PPCG users helped with the creation of this challenge, both in chat and the Sandbox, specifically Martin Ender, AdmBorkBork, Emigna and user202729 Our community has found it necessary to ...
caird coinheringaahin g's user avatar
13 votes
6 answers
1k views

Text to Brain-Flak

Your challenge is to turn input text to brain-flak code that will output the text. Tutorial taken from here with permission here Brain-Flak has two stacks, known as 'left' and 'right'. The active ...
user avatar
15 votes
1 answer
384 views

Strategic Vanishers

This post is loosely inspired by this mathoverflow post. A Vanisher is any pattern in Conway's Game of life that completely disappears after one step. For example the following pattern is a size 9 ...
Wheat Wizard's user avatar
  • 96.5k
13 votes
1 answer
718 views

Let's write a Minifier

Background Minifiers are used, commonly, when serving JavaScript to your Web Browser. It is commonly used to reduce the number of bytes that have to be sent. Saving bandwidth is useful for obvious ...
Neil's user avatar
  • 2,525
15 votes
2 answers
979 views

Mathematical Expression Showdown!

You are given 6 numbers: 5 digits [0-9] and a target number. Your goal is to intersperse operators between the digits to get as close as you can to the target. You have to use each digit exactly once, ...
geokavel's user avatar
  • 6,656
22 votes
8 answers
1k views

Is it a noun or not?

Given a string as input, determine whether it is a noun or not. You will be scored on the 1000 most common English words, by how many you correctly label as a noun or not. The program or function ...
isaacg's user avatar
  • 42k
11 votes
4 answers
2k views

Remove the Salutations

Challenge Hi, given a string as input, remove any salutations found at the start of the string. The program which performs the most correct substitutions in under 50 bytes wins. Salutations Hey, a ...
Beta Decay's user avatar
  • 23.3k
2 votes
0 answers
325 views

Is it a bird, is it a plane? [closed]

Challenge Supplied an image, you must determine if the subject of the image is a bird or a plane. If the image is a bird, your program must output bird and if ...
user avatar
19 votes
5 answers
879 views

Chess Analysis with Limited Information

In this challenge, you are given a limited amount of information about a particular game of chess, and you need to predict who won the game. You are given two sets of data: Piece counts (What pieces ...
Nathan Merrill's user avatar
13 votes
3 answers
844 views

Combinatory Conundrum!

Introduction: Combinatory Logic Combinatory logic (CL) is based off of things called combinators, which are basically functions. There are two basic "built-in" combinators, ...
clismique's user avatar
  • 6,972
11 votes
3 answers
546 views

Print a specific value in the Wythoff matrix modulo 2

The Wythoff matrix is an infinite matrix consisting of the Grundy numbers of each square on a chessboard in Wythoff's game. Each entry in this matrix is equal to the smallest nonnegative number that ...
Joe Z.'s user avatar
  • 34.7k
44 votes
10 answers
4k views

There can be only 1!

Your task is, given a positive integer n, to generate an expression that equals the number n. The catch is: you're only allowed ...
clismique's user avatar
  • 6,972
30 votes
9 answers
2k views

Golf a Brain-Flak Integer

Integers are tedious to represent in Brain-Flak. There are 8 operators: ...
Neil's user avatar
  • 166k
8 votes
4 answers
730 views

Sort a list of unknown values with the least amount of comparisons

In this optimization challenge you will write a program that sorts a single array by only comparing elements through asking the user on stdout to input comparison results on stdin. The below protocol ...
orlp's user avatar
  • 39k
24 votes
2 answers
1k views

Guess the language

Introduction This site is rapidly building up a huge dataset of code snippets, so let's do something with it! Here's a data file. It contains 9,066 unique language+snippet pairs for 113 languages, ...
Dave's user avatar
  • 8,451
24 votes
1 answer
628 views

Domain Name Appraisal

Domain name trading is big business. One of the most useful tools for domain name trading is an automatic appraisal tool, so that you can easily estimate how much a given domain is worth. ...
PhiNotPi's user avatar
  • 29k
12 votes
3 answers
1k views

Reconstruct a missing RGB channel

Look at these photographs of natural scenes, with one of the RGB channels taken out of them: Source (with red): https://en.wikipedia.org/wiki/File:Altja_j%C3%B5gi_Lahemaal.jpg Source (with green): ...
Joe Z.'s user avatar
  • 34.7k
9 votes
4 answers
581 views

Find the shortest way to advance a counter to a certain number

I have a counter. It's a small device that looks like this: The display goes from 0000 to 9999. It has a little push-button at ...
Joe Z.'s user avatar
  • 34.7k
21 votes
2 answers
1k views

Fun with flags!

Write a full program with a source code of 256 bytes or less that looks at an image of a flag and determines what country that flag is from. A zip file containing the 196 different flags in the ...
DJMcMayhem's user avatar
  • 58.9k
16 votes
6 answers
958 views

Who said that? 2016 Presidential election

In this challenge, your task is to make write a program with less than 300 characters that takes a short paragraph or a few sentences that a candidate has said and output who said it. Input: Can be ...
soktinpk's user avatar
  • 4,472
358 votes
7 answers
50k views

Upgoat or Downgoat?

Given an image of a goat, your program should best try to identify whether the goat is upside down, or not. Examples These are examples of what the input may be. Not actual inputs Input: Output: <...
Downgoat's user avatar
  • 28.9k
17 votes
4 answers
3k views

What's the Language?

Recently, the PPCG design leaderboard has been having some trouble parsing answer html headers. In this challenge you'll be taking your own shot at parsing answer headers. Example Test Cases These ...
Downgoat's user avatar
  • 28.9k
8 votes
7 answers
661 views

The branch predictor challenge

Every day, every minute, ... every microsecond, many decisions are made by your computer. In high-level languages, these typically take the form of statements like ...
Doddy's user avatar
  • 197
42 votes
9 answers
5k views

Predict whether a message will be starred or not in 50 bytes

Given an input of a string consisting of any message from our site chatroom taken from the list described and linked below, output either a truthy or a falsy value attempting to predict whether that ...
Doorknob's user avatar
  • 71.4k
13 votes
4 answers
683 views

Build a Nonographic Magnitude Optimizer™

A nonogram is a Japanese puzzle game in which the goal is to draw a black-and-white picture according to a list of contiguous regions, like so: Define the nonographic magnitude of a row or column to ...
Joe Z.'s user avatar
  • 34.7k
15 votes
5 answers
1k views

Build a minimum-clue Sudoku unsolver

My attempt at stating this question, but with a more objective solving criterion. Your task is to build a program or function that takes a solved Sudoku grid S in ...
Joe Z.'s user avatar
  • 34.7k
15 votes
2 answers
857 views

Build a top-front-side puzzle solver

A top-front-side puzzle is a puzzle where you are required to construct a 3-D shape of (usually cubic) blocks given three orthogonal views: a top view, a front view, and a side view. For example, ...
Joe Z.'s user avatar
  • 34.7k
34 votes
1 answer
3k views

Voice recognition: "Yes" or "No"?

Task Implement a program in minimum bytes of source or binary code that does voice recognition of a voice sample (me saying "yes", "yeah" or "no" in voice or in whisper, plainly or quirkily) based on ...
Vi.'s user avatar
  • 2,697
26 votes
2 answers
2k views

Recognize handwritten digits

Your task is to read an image containing a handwritten digit, recognize and print out the digit. Input: A 28*28 grayscale image, given as a sequence of 784 plain-text numbers from 0 to 255, separated ...
aditsu quit because SE is EVIL's user avatar
34 votes
17 answers
5k views

Create a Flood Paint AI

In the game of Flood Paint, the goal of the game is to get the entire board to be the same colour in as few turns as possible. The game starts with a board that looks something like this: ...
Joe Z.'s user avatar
  • 34.7k
7 votes
2 answers
963 views

Build a program that creates a minimal one-ohm resistor diagram for a given resistance

You are a contractor for a company who designs electrical circuits for the various products they make. One day, the company accidentally gets a huge shipment of one-ohm resistors and absolutely ...
Joe Z.'s user avatar
  • 34.7k
51 votes
11 answers
10k views

Build a random number generator that passes the Diehard tests

While there are many code golf questions on here involving randomness, I haven't seen one yet that actually asks for building an algorithmic pseudorandom number generator. There's this one that asks ...
Joe Z.'s user avatar
  • 34.7k
11 votes
2 answers
5k views

Decryption by pattern analysis

You are given an encrypted string, encrypted using a very simple substitution cipher. Problem You do not know what the cipher is but you do know the ciphertext is English and that the most frequent ...
Thomas O's user avatar
  • 3,318