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.

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 ...
62
votes
158answers
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 ...
2
votes
11answers
304 views

Multiplify a number [closed]

Challenge description Multiplification (totally not a made-up word) is a process in which you take two positive integers: a and ...
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 ...
-8
votes
2answers
226 views

Number to String [closed]

Number to String Instructions Convert a signed 32-bit integer to a string (base-10 preferably) without any string formatting calls (or built in type coercion that will directly convert a number to a ...
5
votes
11answers
1k views

Recursion bracketed; or Dyck words generation

We already have challenges to check if a string of brackets is fully matched and to count the number of balanced strings. It remains for us to generate these strings, but it will not be so easy… A ...
4
votes
20answers
2k views

Illiteral Prime numbers [duplicate]

Your challenge is to write a program (full program, not a function), that will take an integer and output all prime numbers up to (including) the given integer. Output is any readable list containing ...
-5
votes
13answers
654 views

Output the alphabet using the alphabet

The title is pretty self-explanatory, isn't it? Your task is to output the alphabet (the string "abcdefghijklmnopqrstuvwxyz") to STDOUT, using each and every ...
-2
votes
2answers
196 views

Restricted average (arithmetic mean) – i.e. without obvious built-ins [closed]

Introduction The arithmetic mean is defined as being equal to the sum of the numerical values of each and every observation divided by the total number of observations. Symbolically, if we have a ...
10
votes
19answers
641 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 ...
6
votes
1answer
426 views

QWERTY Quine Creation

Challenge Create a quine, that instead of outputting it's source, output's it's source QWERTY-sorted. What is QWERTY sorting? QWERTY sorting is sorting code by the QWERTY keyboard. Anything higher ...
72
votes
24answers
4k views

Tweetable hash function challenge

In this code-challenge you will write a hash function in 140 bytes1 or less of source code. The hash function must take an ASCII string as input, and return a 24-bit unsigned integer ([0, 224-1]) as ...
-7
votes
4answers
330 views

Write a palindrome that prints “Hello, World!” without using comments [duplicate]

Your Task: Print "Hello, World!" using a palindrome. Simple, right? Nope. You have one restriction: you may not use comments. "Comments" include Normal // or <...
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 ...
-2
votes
1answer
327 views

Implement branchless binary search

Challenge Implement binary search on a list of length 256 with no branches. Specification Input an integer X and a strictly increasing list of integers Output is ...
-3
votes
1answer
137 views

Implement decimal-multiplication modulo

Most people can't easily do modulus (or work out if a number is divisible by another number) in their heads because long division is harder than addition, subtraction and multiplication. The following ...
28
votes
8answers
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!. ...
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! ...
-7
votes
2answers
224 views

Unique multiplication by ten [closed]

People, it's a popularity contest, you have to do somthing cool here. Think about cool ways of breaking the code in most languages, not about validating for everyting! Initially this challenge ...
12
votes
22answers
2k views

10 9 8 7 6 5 4 3 2 1… Print 2016

As a spin-off to my challenge over at Puzzling, your goal is to output 2016. Rules: You must include the numbers ...
3
votes
1answer
369 views

Detect my accent

Your task is to write a program or function that detects accents in UTF-8 input. The catch is that your code must be written entirely in an 8-bit character encoding. The code will output a single ...
26
votes
2answers
579 views

Lipogram “quine”

Task Take a single Unicode character as input. Output a program in the same language that also obeys this specification, but which does not contain the input character. If your program is run with ...
5
votes
8answers
826 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 ...
19
votes
10answers
5k views

Print the QWERTY keyboard using keys that are as close together as possible

Normally, challenges are scored in bytes, or sometimes Levenshtein distance, but for this one we're using keyboard distance -- the number of keys between the keys used to type the program (use the ...
-3
votes
3answers
435 views

Does the string contain 2016? [closed]

Given a string input, your task is to write a program that prints a truthy value to STDOUT or equivalent if the input contains "2016" anywhere in it without using any built-in ...
24
votes
12answers
2k views

The Complement Cat

Objective Write a full program that outputs (to STDOUT or closest alternative) an arbitrary string of text, no more than 64 characters long. Simple enough, right? Well, here's the catch: You may not ...
9
votes
22answers
832 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 ...
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 ...
44
votes
31answers
7k views

Check if a UUID is valid without using regexes

Given a string input, write a program that prints a truthy value to STDOUT or equivalent if the input is a valid UUID, without using regexes. A valid UUID is 32 hexadecimal digits, displayed in ...
19
votes
2answers
1k views

90° Self-Rotating Program

Introduction Write a complete program that rotates a rectangular block of ASCII characters 90 degrees clockwise. When the program itself is rotated 90 degrees clockwise, it rotates a block of ASCII ...
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 ...
12
votes
5answers
561 views

Avoid repeating letters between five simple programs

You're challenge is to write 5 different full programs for the 5 following tasks: Print Hello, World! Given an input with STDIN, output the factorial, you can ...
18
votes
5answers
2k views

The jQuery showdown

Some time after this incident… There are some of us who are against this defiling order of jQuery. It is an unholy presence, of which must be exterminated. I therefore call on you, the loyal ...
17
votes
4answers
1k views

Print a Symbolic Negative of your Code

(This is a variation on Print a Negative of your Code, which I enjoyed a lot! Thanks to Martin Büttner♦ - almost all of this text is his.) Let's consider the symbols to be the following printable ...
28
votes
20answers
3k views

Print the Capitals without the Capitals

Whoa, whoa, whoa ... stop typing your program. No, I don't mean "print ABC...." I'm talking the capitals of the United States. Specifically, print all the city/...
26
votes
56answers
2k 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 ...
7
votes
14answers
3k views

Shoot the ASCII Moon

(Previously on "Print the __ without using __" ... this one and this one) The game of Hearts has a popular scoring variant called "Shooting the Moon," whereby instead of trying to not acquire penalty ...
-11
votes
5answers
548 views

A Perplexing Puzzle [closed]

The Challenge Create a program or function that takes no input, and outputs (or returns): I'm a programming paradox — no I'm not. Without using a character ...
26
votes
9answers
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 ...
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 ...
33
votes
4answers
622 views

Splitting up ASCII

Given the 95 printable characters in ASCII plus newline, break it apart into two equal, 48 character groups (hereafter called group A and group B). Create a one-to-one mapping of your choice (you have ...
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-...
19
votes
6answers
1k views

Fibonacci in +!()[]script

Write a piece of JavaScript code that calls alert with an array containing the first 50 Fibonacci numbers in order. You may only use the following characters: ...
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, ...
4
votes
0answers
622 views

C# program containing `? null :` that is still valid without `null` [closed]

I found an old post on Jon Skeet's blog that pointed out a puzzle from a tweet by Vladimir Reshetnikov: C# quiz: write a valid C# program containing a sequence of three tokens ...
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 ...
-6
votes
4answers
572 views

Write “Code Golf” without using any letters [duplicate]

Goal Your goal is to write "Code Golf" without using any letters [A-Z, a-z], even in your source code. It can't use of the following special characters either (!, _, <, (, ), ., {, }, ', and >). ...
-10
votes
1answer
3k views

Output your username without using any of the characters in your username! [duplicate]

This is a little meta... I need you to golf some code that takes no input whatsoever but outputs your username. That may seem easy enough, but you are code restricted. For example, if my username was ...
-3
votes
3answers
545 views

Isn't It Ironic? A Little Too Ironic?

I made a joke the other day and sent it to some friends. One replied back "I love the irony!" and I looked at it and realized there was some irony in it. But that wasn't the irony she saw - the irony ...
31
votes
6answers
3k views

Write A Program That Outputs Its Mirror Level

There are 95 printable ASCII characters: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ In the ...