for challenges where the primary part is generating (probably valid) code.
24
votes
2answers
372 views
Hyper about quines
Inspired by Hyperprogramming: N+N, N×N, N^N all in one.
Thanks to @MartinEnder and @trichoplax for their help in the sandbox.
Definitions
Hyperquines
Define a hyperquine of order n as a quine-...
17
votes
2answers
217 views
Given a truth table, output a Stackylogic program that satisfies it
Stackylogic is a programming language I made up in a previous challenge: Run Stackylogic. Read that post for full details and examples, but here is how it works paraphrased:
Stackylogic takes 0's ...
9
votes
16answers
1k views
Code golf for the lazy
Your goal in this code golf is to take two strings, language and code (if the golfed code you wrote for this is multiline, then this variable would be multiline.), and one integer, bytes. They ...
3
votes
3answers
371 views
Do not repeat yourself
Inspired by this challenge
Given a number m, output a program that prints out the string Do not repeat yourself.
Now for the challenging part: Each program the original code prints out has to have ...
-3
votes
3answers
398 views
No Quine Built In? No Problem!
Are you tired of languages with built in quining techniques?
Your challenge, should you choose to accept it, is to add a built-in quine feature to the language of your choice.
Task
Given some ...
0
votes
1answer
148 views
Meta Obfuscate a String [closed]
There are numerous reasons for trying to obfuscate input. These include preventing decompiling, and being a nuiscance.
With this in mind your challenge should your choose to accept it is to write a ...
7
votes
5answers
504 views
Golf me an HQ9+ Compiler [duplicate]
Your task is "simple" should you choose to accept it.
Write an HQ9+ compiler in a language of your choice.
HQ9+ has four commands (as you may be able to tell) H prints "Hello, World!" Q prints out ...
55
votes
20answers
8k views
Rube Goldberg Hello World
For this golf, you will need to use more than one language.
The task
A Rube Goldberg machine is a contraption that takes an enormous number of complicated steps in order to execute a very simple ...
30
votes
11answers
2k views
1-up your average quine
A 1-up quine is a program which is very similar to a quine. The one major difference is that instead of printing itself once, when n copies of the program are concatenated, the result prints the ...
15
votes
12answers
1k views
Write a Metaquine
A metaquine is a program which is not a quine, but whose output, when run as a program in the same language, is a quine.
The goal of this challenge is to write a metaquine. This is code-golf, so ...
8
votes
2answers
211 views
Write a Semiquine
Suppose you have 2 languages, A and B. A string s is a semiquine in A and B if it satisfies the following conditions:
s is a quine in language A.
s is a polyglot in A and B.
The output of running s ...
30
votes
51answers
4k views
Generate 100 Java Tuple classes
Write a script that writes to standard output, or your language's equivalent, 100 lines of (valid) Java code that begins with:
class Tuple1 {public Object _0;}
class Tuple2 {public Object _0,_1;}
...
18
votes
7answers
776 views
Generate Programs in Increasing size
In this challenge, you will write a program which outputs a program which is the double the length of the original program. The outputted program should output a new program a program double its ...
-6
votes
2answers
231 views
Stop Internet Warming! [closed]
Task
Write a program that will output another distinct program, and so on, while using as few distinct characters (and as few bytes) as possible.
For example, program 1 should output program 2, and ...
16
votes
4answers
711 views
Growing Quine Sequence
You are to write a sequence of 10 programs p1 p2 ... p10 that satisfy the following properties:
pK prints pK+1 for K from 1 to 9
p10 prints p10
When the first K programs are concatenated, the ...
23
votes
9answers
2k views
Chaining Programs
Challenge
In this challenge, you will be writing the first program, p1, of an infinite sequence of programs, in which running pn outputs/generates program pn+1. When concatenating the first n >= 2 ...
24
votes
3answers
2k views
Generating Brainf*** NOPs
Sometimes when writing brainfuck code, you feel the need to make it longer than needed to encourage debugging. You could do it by just plopping a >< in there, but what fun is that? You'll need ...
1
vote
1answer
258 views
Escape control characters in a C string
C/C++ use double quotes "" for making string literals. If I want the double-quote itself, or certain other characters, to appear in the string, I have to escape them, like so:
char *s2 = "This is not ...
22
votes
6answers
2k views
Big big numbers
Whilst trying to golf several of my answers, I've needed to write large integers in as few characters as possible.
Now I know the best way to do that: I'll be getting you to be writing this program.
...
9
votes
10answers
1k views
A Program that Prints Programs
Challenge
Your goal is to write a program that prints another program.
That printed program should print another program, and the new program should print another program, until the end.
Rules
Each ...
27
votes
2answers
596 views
Convert Brainfuck to MarioLANG
MarioLANG is a two-dimensional programming language where the source code resembles a Super Mario Bros. level. Furthermore, its instruction set is very similar to Brainfuck's. This means that ...
4
votes
2answers
588 views
Quit Whining; Start Quining
Goal:
Write a function or program that, given an integer n, will output a program in the same language that is a quine with a period of n.
Description of Output Program:
The output program needs to ...
2
votes
2answers
279 views
Quine permutation group
Write a program or function which, when run, outputs another program or function which is valid in the same language as the original program, and which itself will output another program or function ...
14
votes
2answers
734 views
Translate RoboCritters into Brainf***
RoboCritters (etymology) is a brand new esoteric programming language (don't bother searching for it, I just invented it). It's a variant of Brainfuck (BF), slightly more complex than the usual ...
3
votes
6answers
741 views
Convert Brainfuck to a Non-Golfing Language
Input:
Any Brainfuck program. This includes brainfuck programs with comments such as +++COMMENT[>+++<-]..
Output:
A program in one of the below languages that produces the same output as the ...
0
votes
1answer
88 views
Pythy Finite Ordinals [duplicate]
Write a program in any language that takes a single natural number n as input and generates a Pyth program that, in turn, produces, using nested lists, the nested set given by S(n), where:
S(0) = ∅
...
20
votes
5answers
2k views
Make the largest infinity that you can!
The ordinal number system is a system with infinite numbers. A lot of infinite numbers. So many infinite numbers that it literally does not have an infinity to represent its own infiniteness. The ...
18
votes
2answers
835 views
String to Image
A bit of background:
When I first learned about Brainf*ck, one of the first things I did was to write a Java application that would take in a string and create a, somewhat, optimized program to print ...
6
votes
2answers
415 views
Implement multiplication by a constant with addition and bit shifts
While looking at the ARM instruction set, you notice that the ADD instruction has the so-called "Flexible second operand", which can be abused for quick multiplication. For example, the following ...
11
votes
4answers
592 views
Encoding an URL in brainfuck
Inspired by this question, your goal today is to encode an URL in brainfuck.
My browser has been hacked! The location bar has been turned into a brainfuck interpreter. I need a program that turns an ...
8
votes
3answers
726 views
Self-shortening Prime Tester
Let's get right in to it.
Your challenge is to make a program that does these things depending on its input:
If the input is a number, output "Prime" if the number is a prime number and "Not prime" ...
11
votes
8answers
763 views
Generate a Brainf_ck program that outputs a string of given length
Your friend is trying to break into a vault that has a peculiar locking system: it requires a certain number of gentle knocks in a particular spot. Your friend discovered the number (which is in the ...
15
votes
5answers
907 views
Make any number by repeatedly adding 2 numbers
You are given a machine with two 16-bit registers, x and y. The registers are initialized x=1 and y=0. The only operation the machine can do is addition modulo 65536. That is:
x+=y - x is replaced by ...
12
votes
2answers
561 views
Generalized Quine Generator
The Challenge
In this challenge, you specify a source language S and a target language T. Your task is to write the following program P in the language S. If a valid program Q in the language T is ...
10
votes
8answers
1k views
Create a FizzBuzz compiler
Welcome to the world of compiler golf. Your task is to write a program that generates another program to play a variant of FizzBuzz on spec.
Your compiler
Write a compiler that generates variants of ...
13
votes
6answers
1k views
Fibonacci program lengths
Write a program with length n that outputs another program whose length is the next Fibonacci number after n. The new program must do the same thing - output another program whose length is the next ...
2
votes
2answers
282 views
Generate code in another language [duplicate]
Write a program in language A which outputs a program in language B where:
Language A != Language B
The output is itself a solution to this question.
This is a popularity contest. If you want to ...
8
votes
2answers
598 views
Create self-extractor script (relaxed rules)
This is the target language-relaxed version of Generate a self-extractor application
Create a program in any language, that takes an arbitrary binary input, and generates a valid program (also in any ...
5
votes
2answers
475 views
Generate a self-extractor application
Create a program in any language, that takes an arbitrary binary input, and generates a valid C++11 program, which when compiled and run will print this binary input.
So you could do this (on linux ...
11
votes
2answers
779 views
Compile Regexes
In this task you have to write a program that reads a regular expression and generates another program that outputs whether an input string is accepted by that regular expression. The output must be a ...
17
votes
4answers
1k views
Convert Fractran into Brainfuck
Background
Fractran is an esoteric Turing-complete programming language invented by John Conway. A Fractran program consists of an ordered list of fractions. The program starts by taking a single ...