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.

10
votes
12answers
1k views

Output the ŋarâþ crîþ alphabet song without using (m)any letters

Your goal is to write a program that takes no input and outputs the following text: ...
63
votes
62answers
8k views

Write lines in detention

Introduction Bad news guys - you got detention. Your English teacher doesn't understand this site and wants you to "stop doing math on your digital dohickeys, this is English class!" She sentenced ...
27
votes
13answers
2k views

Pristine Bit Checking

Write a program/function that takes two integers in the range \$0\$ to \$255\$ inclusive, and returns whether the binary forms of the numbers are exactly one bit different. For example, \$1\$ and \$...
16
votes
3answers
457 views

MacGyver's Second Toolbox

In this question each answer will get a "toolbox" that can be used to construct a program/function. The toolbox will consist of two things: a list of programming languages a list of valid characters ...
69
votes
76answers
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 ...
30
votes
12answers
2k views

Write a Quine Suite

We've had a lot of quine challenges, but a lot of the quine formats are similar, lets create some variance in our quines. Your task is to create a selection of programs in the same language (at least ...
31
votes
9answers
7k views

Build a twisted “Hello world!”

Your job is quite simple, write a program that prints Hello, world!, that when twisted creates a program that prints Twister!. ...
78
votes
47answers
7k 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. ...
568
votes
259answers
206k 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 ...
65
votes
79answers
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, ...
105
votes
49answers
13k 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 ...
83
votes
31answers
15k views

Eww, those bytes are gross

Write a program or function that, when given a string, filters out as many distinct bytes as it can and returns the cleaned string. However, since your program hates them, none of these bytes can be ...
22
votes
14answers
2k views

Khinchin's constant to as many decimal places as possible in 64 bytes or less

Khinchin's constant is a curious mathematical constant that, according to Wolfram MathWold, is "notoriously difficult to calculate to high precision". Here it is to 100 digits: 2....
210
votes
108answers
31k 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 "...
25
votes
42answers
2k views

Answer-Chaining Fibonacci

(Inspired by ASCII's 95 Characters...95 Movie Quotes) The Challenge Given input n, output the nth Fibonacci number. You ...
44
votes
4answers
2k views

Multiply with restricted operations

There's a 500 rep unofficial bounty for beating the current best answer. Goal Your goal is to multiply two numbers using only a very limited set of arithmetic operations and variable assignment. ...
22
votes
23answers
1k views

Lookup without conditional statements

This challenge was inspired by programming an Arduino microcontroller. I have 6 LEDs and 6 buttons connected to various pins on the board. In the code, each button and LED is assigned an ID number (1-...
7
votes
12answers
496 views

Multiply using ***Real*** numbers

Inspired by a restriction on What do you get when you multiply 6 by 9? (42) By order of the President, we are no longer permitted to use confusing fake numbers (i.e. numbers other than integers from ...
39
votes
74answers
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 ...
64
votes
160answers
17k 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 ...
14
votes
57answers
16k views

Write a function that takes (x, y) and return x to the power of y WITHOUT Loops [closed]

This is a really neat short challenge. Write a function or a procedure that takes two parameters, x and y and returns the ...
18
votes
31answers
5k views

Find the number of leading zeroes in a 64-bit integer

Problem: Find the number of leading zeroes in a 64-bit signed integer Rules: The input cannot be treated as string; it can be anything where math and bitwise operations drive the algorithm The ...
210
votes
17answers
20k 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 ...
12
votes
15answers
9k views

Compare two integers in C or C++ without comparison operators

Produce the shortest program which takes two signed integers as input (through stdin or as arguments) and displays 3 different outputs depending upon whether the first number is (1) greater than, (2) ...
28
votes
10answers
2k views

Heterograms, Palindromes, oh my!

(First challenge, please let me know if there are any problems with it.) A heterogram is a word where no letter of the alphabet occurs more than once, and a palindrome is a phrase that is the same ...
45
votes
23answers
4k views

A Chiral Puzzle

A shape is chiral if no amount of rotation can make it look like it's mirror image. In this puzzle we will be writing chiral computer programs. For this puzzle we will think of a program as a ...
87
votes
23answers
11k 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 ...
23
votes
17answers
4k views

The real treasure was the numbers we made along the way

Your task is to write a program, function or snippet (yes, snippets are allowed) that simply outputs an integer. However, you must be able to separate your submission into prefixes that also produce ...
11
votes
9answers
393 views

The Great Pyramid of Quine

The task is a rather simple quine challenge with a twist, you must output your source code in the shape of a pyramid. The shape of a pyramid is defined below: ...
36
votes
11answers
2k views

A well linked challenge

An activity I sometimes do when I'm bored is to write a couple of characters in matching pairs. I then draw lines (over the tops never below) to connect these characters. For example I might write \$...
18
votes
12answers
2k views

In for a bumpy ride

Your task is to write a computer program or function that takes a list of positive integers of at least length 2 and determines if they are a "zigzag". A sequence is a zigzag if and only if the ...
-7
votes
1answer
257 views

This ain't it Chief

This is mostly for the memes. I regret existing. Rules Your code has to output, by either printing or showing in stdout, the phrase This ain't it Chief. in that ...
119
votes
119answers
36k 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 ...
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 ...
23
votes
44answers
4k views

Adding without using a + or - sign

There have been many "Do __ without __" challenges before, but I hope that this is one of the most challenging. The Challenge You are to write a program that takes two natural numbers (whole numbers ...
8
votes
19answers
702 views

Toasty, Burnt, Brûlée!

It turns out that my toaster is a tad broken. It lost WiFi (You know, it's one of those newfangled smart toasters), and its been going bonkers! Since it no longer works, I've been having to hack into ...
41
votes
8answers
5k views

Write a Quine in Plain English

Write a quine that consists of real English words separated by single spaces. A "word" is defined as a string containing only lowercase and uppercase letters (...
26
votes
2answers
1k views

Fastest Mini-Flak Quine

Mini-Flak is a subset of the Brain-Flak language, where the <>, <...> and [] ...
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 ...
-8
votes
2answers
150 views

No-alphanumeric code exec

Introduction In most interpreted languages, there is an operation that will run code generated at runtime. It generally requires alphanumeric characters to refer to this operation. Write a program, ...
10
votes
34answers
2k views

Number of rotations

Task Write a function or a program to find the number of rotations required by a wheel to travel a given distance, given its radius. Rules Input can be 2 positive rational numbers and can be taken ...
1
vote
2answers
198 views

Work out \$x^y\$ using only addition and subtraction [duplicate]

The challenge is to implement a function or program that takes two numbers, \$x\$ and \$y\$ and return the result of \$x^y\$. The program cannot use any other mathematical operation other than \$+\$ ...
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 ...
5
votes
8answers
830 views

Using Symbols for Letters

Input: A single word as a string (matches [a-zA-Z]+). If the input doesn't follow these guidelines, print "Error" (but no error should be thrown) Output: The ...
10
votes
19answers
681 views

Find the positive divisors!

Definition A number is positive if it is greater than zero. A number (A) is the divisor of another number (B) if ...
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 ...
42
votes
28answers
2k views

Surprise Party for Brain-Flak

This question is part of a series Brain-flak Birthday challenges designed to celebrate Brain-Flak's first Birthday. You can find more information about Brain-Flak's Birthday here. Today is Brain-Flak'...
15
votes
18answers
914 views

Alphanumeric balance

Write a program which gets a string as its input, and counts the number of alphanumeric and non-alphanumeric characters in it. It has to display its result like this: input: ...
50
votes
43answers
9k views

Print every printable ASCII character without using it

In a programming language of your choice, write 95 programs, each of which outputs a different one of the 95 printable ASCII characters without that character occurring anywhere in the program. For ...
152
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 ...