Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

119
votes
119answers
35k 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 ...
566
votes
259answers
204k 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 ...
111
votes
71answers
23k views

Largest Number Printable

Your goal is to write a program that prints a number. The bigger the number, the more points you'll get. But be careful! Code length is both limited and heavily weighted in the scoring function. Your ...
38
votes
9answers
5k 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 ...
119
votes
95answers
20k 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! ...
102
votes
48answers
12k 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 ...
84
votes
22answers
10k 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 ...
37
votes
72answers
9k views

Add without addition (or any of the 4 basic arithmetic operators)

Problem: Your goal is to add two input numbers without using any of the following math operators: +,-,*,/. Additionally, you can't use any built-in functions that ...
62
votes
17answers
6k 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 ...
25
votes
10answers
3k 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 ...
22
votes
25answers
6k 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 ...
207
votes
105answers
30k 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 "...
150
votes
57answers
21k 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 ...
64
votes
11answers
3k 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 ...
17
votes
10answers
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 ...
8
votes
17answers
3k 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, ...
42
votes
14answers
7k 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: ...
30
votes
16answers
6k 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 ...
22
votes
27answers
2k 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, ...
20
votes
21answers
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 ∪ ...
103
votes
67answers
25k 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 ...
77
votes
97answers
12k 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/...
43
votes
1answer
947 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, ...
79
votes
71answers
15k 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 ...
30
votes
69answers
8k 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: ...
35
votes
50answers
6k views

Capitalize first letter of each word of input

This is a relatively quick one, but I'm sure you'll like it. Codegolf a program that will take input in the form of a sentence and then provide the output with the first letter capitalized in each ...
67
votes
73answers
5k 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 ...
54
votes
15answers
4k views

Write the whole of the holed using the unholed

The ASCII characters from decimal code 33 to 126 are: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ...
53
votes
23answers
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, ...
25
votes
11answers
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". Enjoy! ...
27
votes
18answers
6k 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 ...
4
votes
28answers
1k 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 ...
4
votes
49answers
6k 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 ...
2
votes
8answers
396 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, ...
85
votes
132answers
41k views

Loop without 'looping' [closed]

A question similar to this has been asked a couple of years ago, but this one is even trickier. The challenge is simple. Write a program (in your language of choice) that repeatedly executes code ...
208
votes
17answers
19k 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 ...
70
votes
111answers
14k views

Print the alphabet without using each vowel

Inspiration: in 1939, a man named Ernest Vincent Wright wrote a novel called Gadsby without using the letter 'e'. Your task is to write a set of (up to 5) programs in any language (which has a text-...
54
votes
7answers
7k views

Duct tape can fix Mother's Day

Based on the Duct tape can fix anything question, that was too broad, with very similar rules. Only this time the objective is very specific: The challenge Your mission is to make a program that ...
46
votes
2answers
2k 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 ...
72
votes
35answers
11k 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-...
64
votes
74answers
6k views

Three-Three-Three!

Write a program that produces an output such that: At least three distinct characters appear. The number of occurrences of each character is a multiple of 3. For example, ...
47
votes
38answers
6k 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 ...
71
votes
27answers
6k views

2016 Time Capsule String: How Versatile Is Your Language?

About a year ago on Dec 31, 2015, I had the idea that: We should make a time capsule string. Everybody gets to add one character and next new years we'll see who can make the best program out of ...
2
votes
7answers
818 views

Kolmogorov Complexity Meta Golfer

Mike Bufardeci (Pyth) - 175 bytes Leo (Retina) - 175 bytes devRicher (Lua) - 182 bytes Peter Taylor (CJam) - Waiting for clarification Lyth (C++11) - Waiting for clarification Edit: Several changes ...
53
votes
20answers
8k views

Exit Code Golfing

Inspired by this default for IO. The Task Write a program that, given an input integer x between 0 and 255, crashes with exit code ...
40
votes
23answers
7k views

Holy Hole In A Donut, Batman!

Some characters are more holy than others. Using as few unholy letters as possible, display the statement above. Challenge Write a full program to print ...
48
votes
133answers
6k 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 ...
46
votes
63answers
5k views

Depalindromize this string!

Given a palindrome generated according to this challenge, depalindromize it. Test cases ...
33
votes
69answers
3k 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 ...
32
votes
5answers
1k 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 ...