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.

Filter by
Sorted by
Tagged with
48
votes
66answers
5k views

Depalindromize this string!

Given a palindrome generated according to this challenge, depalindromize it. Test cases ...
78
votes
100answers
13k 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/...
155
votes
62answers
22k 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 ...
71
votes
112answers
15k 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-...
70
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 ...
107
votes
51answers
14k 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 ...
-8
votes
15answers
620 views

Count up from 0 to 2017 without numbers in your source

This question was profoundly inspired by Joe Z's question. But, with a twist... So, now that it's almost 2017, it's time for a code question involving the number 2017. Your task is to make a ...
81
votes
39answers
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. ...
54
votes
24answers
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, ...
2
votes
11answers
695 views

Hello… eh, who?

Introduction You started to write a "Hello, World!" program, but after you wrote the part to print the hello, you forgot what your program should actually print. So now, you somehow managed it to ...
577
votes
273answers
210k 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 ...
74
votes
37answers
12k 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-...
29
votes
63answers
3k views

Palindrome Hello, World

Your task is to create a program that prints "Greetings, Planet!" exactly to the console. Seems simple enough, right? Well, here's the trick. The code must be a palindrome, meaning it reads from right ...
12
votes
13answers
2k 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: ...
64
votes
20answers
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 ...
40
votes
75answers
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 ...
123
votes
124answers
37k 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 ...
13
votes
9answers
2k views

Print the first 128 prime numbers without using any reserved words

The obvious solution would be to just print them as a string, but is it possible to write a shorter code? Requirements: No input should be processed, and the output should be in the form of ...
36
votes
22answers
6k views

I don't even… I only odd!

Your task is simple: write a program that receives an integer as input and outputs it if it was odd, and does nothing otherwise (not halting is allowed). The challenge is, that you can only use odd ...
56
votes
50answers
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 ...
43
votes
62answers
7k views

The Real Slim Shady

Echo the following in as few bytes as possible: ...
14
votes
4answers
796 views

Branch differently in x86 / x86-64 using only printable visible ASCII characters in the machine code

The task is simple: write a program that branches differently in x86 (32-bit) and x86-64 (64-bit) using only printable visible ASCII characters 0x21...0x7e (space and del are not allowed) in the ...
65
votes
79answers
7k 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, ...
44
votes
122answers
13k views

Output programming language name

Challenge: In the programming language of your choice, take no input and output your programming language's name. Fair enough, right? Restrictions: You can't use any character that is included in ...
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 ...
79
votes
72answers
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 ...
41
votes
9answers
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 (...
53
votes
143answers
7k 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 ...
212
votes
19answers
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 ...
30
votes
12answers
3k views

Say Hello to the Pioneers of Computer Science

Choose your favorite famous computer scientist or computer science pioneer who was born in 1942 or earlier (as 1943 marks the start of the creation of the 'first' computer). They should have a ...
28
votes
14answers
3k 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 \$...
226
votes
111answers
32k 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 "...
113
votes
72answers
24k 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
7answers
346 views

Print the previous answer in reverse - with a catch (pt. 2)

Your challenge is very simple: output the previous answer, in reverse. However, as with this similarly-titled question, there's a catch: in this case, you cannot use characters from the answer before ...
7
votes
4answers
909 views

Write an URL compressor

Today your goal is to invent URL compression. You must write two programs: a compressor and a decompressor. The compressor will be called with one URL on stdin and its output will be read on stdout. ...
49
votes
29answers
10k views

Print the phrase “And she said, 'But that's his.'” using only the alphabet

Print the phrase And she said, 'But that's his.' using only the following characters: ...
-5
votes
5answers
110 views

Report divisibility with arithmetic integer operations only [closed]

Given two numbers, the first is greater than the second, check whether the first number is divisible by the second without a remainder. If divisible, answer "yes"(...
11
votes
22answers
932 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 ...
29
votes
18answers
2k views

Inverse-quotes-quine

The prospect of this challenge is: If your program is run normally, all of the code in the speech marks (" - double quotes) should be printed. If your program is ...
48
votes
65answers
10k views

Divide a number by 3 without using *, /, +, -, % operators

Quoting this question on SO (Spoiler alert!): This question has been asked in an Oracle interview. How would you divide a number by 3 without using *, /, +, -, %, operators? The number ...
6
votes
6answers
259 views

Inverse-quotes-quine, inverted (pt. 2)

Based on a comment by Jo King on my previous question (called 'Inverse-quotes-quine'), I present this new question. The rules are similar, but just, the opposite: If your program is run normally, all ...
51
votes
43answers
7k 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 ...
-6
votes
2answers
308 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 ...
0
votes
2answers
198 views

Alphabet without the alphabet [duplicate]

You are tasked with displaying the string "ABCDEFGHIJKLMNOPQRSTUVWXYZ" and only that, except for trailing newlines if they're unavoidable. You must not output any homoglyphic characters like Cyrillic ...
67
votes
164answers
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 ...
16
votes
32answers
1k views

Maximizing output from minimal input

Obviously, code golfing is all about making the most of the least code. Who really cares what the actual output is? While we have had a challenge for highest input-to-output ratio, this is a call for ...
40
votes
12answers
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 \$...
34
votes
56answers
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 ...
85
votes
33answers
16k 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 ...
63
votes
62answers
9k 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 ...