Questions tagged [test-battery]
A problem whose scoring criterion involves running the output of a program through a large number of test cases.
47
questions
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 ...
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 ...
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 ...
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 ...
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: ...
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 ...
18
votes
1
answer
676
views
Golfing Expressions
We can write mathematical expressions using the standard math operators (,),+,...
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 ...
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.
...
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. ...
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 ...
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ċäḷṡ ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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, ...
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 ...
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 ...
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 ...
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 ...
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, ...
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 ...
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 ...
30
votes
9
answers
2k
views
Golf a Brain-Flak Integer
Integers are tedious to represent in Brain-Flak. There are 8 operators:
...
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 ...
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, ...
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. ...
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): ...
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 ...
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 ...
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 ...
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:
<...
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 ...
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 ...
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 ...
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 ...
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 ...
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, ...
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 ...
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 ...
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:
...
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 ...
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 ...
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 ...