Questions tagged [restricted-source]
Imposes a restriction on the source code used to solve the challenge, for example, having no numbers in the source code.
143
questions
153
votes
84
answers
25k
views
Fewest (distinct) characters for Turing Completeness
Summary:
For any given language, what is the smallest amount of unique characters for your language to be Turing-Complete?
Challenge:
For any language of your choice, find the smallest subset of ...
138
votes
150
answers
44k
views
Obfuscated Hello World
Create the shortest possible obfuscated program that displays the text "Hello World".
In order to be considered an obfuscated program, it must meet at least two of the following requirements:
Does ...
630
votes
337
answers
242k
views
Produce the number 2014 without any numbers in your source code
Note to challenge writers as per meta consensus:
This question was well-received when it was posted, but challenges
like this, asking answerers to Do X without using
Y
are likely to be poorly received....
93
votes
23
answers
12k
views
Programming a Pristine World
Let's define a pristine program as a program that does not have any errors itself but will error if you modify it by removing any contiguous substring of \$N\$ characters, where \$1 \le N < \text{...
42
votes
17
answers
6k
views
Tips for restricted source in Python
Just like code-golf, restricted-source pushes one to exploit quirks and hidden features of the Python language. We already have a place to collect all these tips for code-golf, those for restricted-...
41
votes
9
answers
6k
views
"Convenient palindrome" checker
If you've ever tried to write palindromic code before, you'd know how much brackets tend to get in your way. ()() is not a palindrome, even though it kinda looks ...
169
votes
73
answers
25k
views
How high can you count?
Challenge:
Your task is to write as many programs / functions / snippets as you can, where each one outputs / prints / returns an integer. The first program must output the integer ...
123
votes
95
answers
23k
views
ASCII's 95 Characters...95 Movie Quotes
Update: The winner has been decided, but the challenge is not over!
Finally, nearly 3 months after the question first started, someone has remained the last answerer for more than a week! ...
38
votes
19
answers
6k
views
Calculate 500 digits of pi
Write a program to calculate the first 500 digits of pi, meeting the rules below:
It must be less than 500 characters in length.
It cannot include "pi", "math.pi" or similar pi constants, nor may it ...
32
votes
47
answers
7k
views
Implement hyperexponentiation/tetration without the use of '^' [closed]
The Challenge
Implement tetration (aka Power Tower or Hyperexponentiation) with the least amount of characters.
The Conditions
Don't use the 'power' operator or its equivalents (such as ...
272
votes
147
answers
37k
views
Without using numbers, get the highest salary you can. But don't exaggerate!
As I'm applying for some jobs whose job advert doesn't state the salary, I imagined a particularly evil interviewer that would give the candidate the possibility to decide their own salary ...by "...
106
votes
65
answers
12k
views
Find an Illegal String
The challenge is to find a string of characters that cannot appear in any legal program in your programming language of choice. That includes comments, strings, or other "non-executable" parts.
...
74
votes
155
answers
14k
views
Print X without X (cop's thread)
This is the cop's thread of a cops-and-robbers challenge. You can view the robber's thread here
A pretty common beginner style question is to print some string, but there's a catch! You need to do it ...
67
votes
20
answers
7k
views
Just repeat yourself
Write a program that outputs
Do not repeat yourself!
Your program code must respect the following constraints :
its length must be an even number
each ...
22
votes
25
answers
10k
views
Look and say sequence [duplicate]
The look and say sequence is a basic form of run length encoding.
The sequence starts with the number 1 and each additional number encodes the number of digits that are repeated before each digit ...
11
votes
44
answers
2k
views
Hello ASCII World!
Construct a full program which outputs Hello, World!. The score of your submission will be equal to the sum of all of the ASCII values of the distinct characters. ...
7
votes
17
answers
4k
views
Multiply without multiply [closed]
Write the fastest (best big-O) and smallest multiplication algorithm for positive integers, without using multiplication operators. You are only allowed addition, subtraction, logical functions (AND, ...
45
votes
142
answers
12k
views
Print X without X (robber's thread)
This is the robber's thread of a cops-and-robbers challenge. You can view the cop's thread here
A pretty common beginner style question is to print some string, but, there's a catch!, you need to do ...
23
votes
40
answers
3k
views
Palindromic palindrome generator
Create a program, that converts input string to a palindrome starting with the input string. The program itself must be a palindrome.
For example input: neverod, ...
19
votes
21
answers
2k
views
Length of String Using Set Theory
From Wikipedia Set-theoretic definition of natural numbers
The set N of natural numbers is defined as the smallest set containing
0 and closed under the successor function S defined by S(n) = n ∪ ...
86
votes
225
answers
23k
views
The Letter A without A
Your task is to display the letter "A" alone, without anything else, except any form of trailing newlines if you cannot avoid them, doing so in a program and/or snippet. Code that returns (instead of ...
75
votes
193
answers
9k
views
Output your Score!
Challenge:
The concept is simple enough: write a full program to output its own code golf score!
Output should only be the byte count of your program and a trailing ...
74
votes
173
answers
17k
views
Print 0 to 100 without 1-9 characters
Print integers 0 to 100 (inclusive) without using characters 123456789 in your code.
Separator of numbers can be comma or white space (by default <blank>, <...
73
votes
84
answers
6k
views
No strings (or numbers) attached
If you like this, consider participating in:
The Official Dyalog APL 2016 Year Game
The monthly Dyalog APL 2017 Code Golf Challenge
Make 12 snippets/expressions, in the same language, that result in ...
66
votes
11
answers
4k
views
Only Even Bytes
The scenario
Lately you have been noticing some strange behavior with your favorite text editor. At first it seemed that it was ignoring random characters in your code when writing to disk. After a ...
53
votes
53
answers
8k
views
Print all ASCII alphanumeric characters without using them
Challenge
Print the following characters:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890
The catch is that you may not use any one of them in ...
47
votes
1
answer
1k
views
Cyclic Levenquine
Background
As most PPCG regulars will know, a quine is a program which outputs its own source code when run; and the Levenshtein distance between two strings is the minimum number of insertions, ...
43
votes
17
answers
8k
views
What's the shortest contiguous subset of ASCII you need to output the rest?
The printable ASCII characters (hex codes 20 to 7E) in order are:
...
38
votes
3
answers
5k
views
Primality testing formula
Your goal is to determine whether a given number n is prime in the fewest bytes. But, your code must be a single Python 2 expression on numbers consisting of only
...
30
votes
13
answers
7k
views
Multiply two numbers without using any numbers
You are given as input two strings representing positive integers in base 10, such as "12345" and "42". Your task is to output a ...
19
votes
13
answers
2k
views
The Symbols vs. The Letters
The Symbols vs. The Letters
The ASCII characters have been divided once again! Your sets are The Letters and The Symbols.
The Letters
...
235
votes
30
answers
24k
views
DISARM THE B.O.M.B.!
You have been hired for your tech knowledge as a Secret Agent's sidekick to ensure that the good guy can get his job done and the world can be saved.
This is your last mission before retiring with a ...
118
votes
76
answers
28k
views
I'm a palindrome. Are you?
There have been a couple of previous attempts to ask this question, but neither conforms to modern standards on this site. Per discussion on Meta, I'm reposting it in a way that allows for fair ...
90
votes
108
answers
15k
views
Hello World 0.0!
source: Dilbert, September 8, 1992
I'm hoping to add a new twist on the classic "Hello World!" program.
Code a program that outputs Hello World! without:
String/...
84
votes
42
answers
13k
views
Non-discriminating Programming
We say a string is non-discriminating if each of the string's characters appears the same number of times and at least twice.
Examples
"aa!1 1 !a !1" is non-...
81
votes
71
answers
16k
views
Hello world! with limited character repetition
In a language of your choice, write a program that exactly outputs the characters Hello world! followed by a newline. The code:
should not use any character more ...
58
votes
19
answers
5k
views
Write the whole of the holed using the unholed
The ASCII characters from decimal code 33 to 126 are:
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
...
55
votes
24
answers
6k
views
Significant Whitespace
We define whitespace to be any of the three characters, tab (0x09), newline (0x0A) or space (0x20).
For this challenge, you're to write two programs or functions in the same programming language, ...
54
votes
2
answers
4k
views
JSF**k with only 5 symbols?
This is not a challenge but a question, I figured it was on topic because of
Non-challenge questions that are related to solving programming puzzles or a particular type of challenge are also on ...
33
votes
5
answers
2k
views
Left Hand vs. Right Hand — Typists Challenge
Your task is to pit each side of the keyboard against each other and build two programs, in the same language, one using only keys on the left-hand side of a standard keyboard that outputs ...
33
votes
72
answers
4k
views
Restricted mini challenges Cop's Thread
Robber's thread
Your task as cops is to select three things:
A programming language
An OEIS sequence
A byte set
You are then to secretly write a program in that language that computes the nth term ...
29
votes
69
answers
12k
views
Check whether an integer is a power of 2 without using +,- operations [closed]
Write a program that checks if the integer is a power of 2.
Sample input:
8
Sample output:
Yes
Sample input:
...
28
votes
27
answers
4k
views
Minimal maximum byte for Turing Completeness
Summary
We already have a challenge for the minimal number of characters for Turing completeness. But what about the minimal maximum byte?
Challenge
For a language of your choice, find a subset of ...
27
votes
19
answers
7k
views
Shortest Sorted Hello World
Write a program that takes no input and prints Hello, World! to stdout or your language's closest alternative. The catch is that each line in your program must only ...
26
votes
11
answers
2k
views
Official Dyalog APL 2016 Year Game
If you think this could be fun, but too much work, consider participating in this much smaller challenge.
A bit of fun (and possibly frustration!) for 2016... Dyalog's "puzzle of the year". ...
26
votes
7
answers
6k
views
JSFuck Golf - Hello World
JSFuck is an esoteric language in which any Javascript statement can be accurately reproduced into another valid Javascript program that uses only the 6 characters ...
11
votes
5
answers
962
views
Raise to the Power
Challenge
Challenge is writing a program that takes a positive numbers a and a nonzero number b and outputs ...
5
votes
49
answers
11k
views
Find the absolute value of a number without built-in functions [closed]
The challenge is to take any real number as input and output or return the absolute value. You may not use any built-in functions other than those dealing with input and output/returning. This is code ...
3
votes
27
answers
2k
views
Implement an integer parser
Implement an integer parser in the shortest code possible, with the following restrictions:
The function or program can only take one argument: a string (or equivalent). Assume it to be signed and ...
2
votes
8
answers
447
views
Exponentiation of natural numbers using only primitive integer operations [duplicate]
The challenge
Implement the C equivalent of the pow() function (exponentiation) for natural numbers, in a language of your choosing, using only addition, ...