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.

13
votes
10answers
1k views

Quoting Big Brother

Task: Have your program randomly choose one of the following two quotes at runtime and print that one quote, exactly as shown. 1: ...
41
votes
59answers
7k views

The Real Slim Shady

Echo the following in as few bytes as possible: ...
46
votes
14answers
6k views

Make a code square with your favorite word

Pick your favorite 6 letter common English word that has no repeated letters, such as wombat. Write a program in an N×N grid of characters without comments such ...
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{|}~ ...
7
votes
12answers
775 views

Convert numbers to symbols without string or char literals

Read infinitely from stdin, and convert every number to the corresponding symbol on a US qwerty keyboard. No string or character literals anywhere are permitted. E.g. if the input is ...
9
votes
3answers
744 views

Calculate to how many cubes one cube can be cut

Imagine some cube which we can cut into smaller cubes without remaining pieces. Find to how many cubes a cube can be cut. For example, a cube can be cut into 8, 27 (obviously 3rd powers of integers) ...
20
votes
13answers
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....
46
votes
50answers
7k views

Rock Around the Clock

In as few Unicode characters as possible, print the following (144 characters): ...
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 ...
1
vote
2answers
1k views

Babylon.js - loop through a scene and apply a simple fragment shader to all of the objects

You have a library - a fully loaded 2014 Babylon.js. You have a fragment shader - let's call it sample.fragment.fx. You have a scene - loaded ahead of time, possibly from a .babylon JSON file. Your ...
3
votes
1answer
2k views

A Most Excellent Code Golf Adventure

You dudes, the Most Excellent Adventure is a home brew roleplaying game system based on the Bill & Ted Films, plays gnarly air guitar riff. In this game system, when you draw from your dice pool ...
20
votes
16answers
4k views

Determine if an integer is divisible by 3

Your goal is to determine if a number is divisible by 3 without using conditionals. The input will be an unsigned 8 bit number from 0 to 255. Creativity encouraged! You are ONLY allowed to use ...
-3
votes
9answers
406 views

Restricted minumum

You need to find the sum of minimum values of two list (same size) of small numbers. In a C like language, that could be expressed as: ...
3
votes
5answers
487 views

Increment Bitwise

Make a function that increments a number using only bitwise, loops, and conditions. Rules: All entries must be as per the language spec defined below. Scoring is not of code length, but of the ...
4
votes
7answers
2k views

Not-endless Recursion without a base case [closed]

Write a recursive function/program, to calculate either the Factorial or the Fibonacci number of a given non-negative integer, without explicitly implementing the base case(s). Your program/function ...
2
votes
2answers
1k views

Find nth root of variable without using math operators/functions

Write a program which, given two positive integers n and x, will display the n-th root of x (which is also x1/n) in decimal to an accuracy of 0.00001. The program must output the resulting number in ...
6
votes
3answers
1k views

Negate a number

You are to accept, on standard input, one number. You will then output the negation of that number. Your code will do nothing else. You may accept various formats if you wish (like "one" or ("uno+2....
20
votes
1answer
1k views

Efficient error-free* encoding [closed]

The mission As is well known, the genetic material of all known creatures on Earth is encoded in DNA; using the four nucleotides adenine, thymine, cytosine, and guanine. (Commonly represented by ATGC)...
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 ...
3
votes
21answers
4k views

Print 123454321 without if statements and using only 2 variables [closed]

The challenge: Write a function, that delivers following output: "1 2 3 4 5 4 3 2 1". Kids stuff? Of course. But here's the point: You only can use: 1 for loop, 2 int variables. You must not use: IF ...
13
votes
8answers
5k views

Calculate the square root only using ++

Your task is to calculate the square root of a positive integer without using any mathematical operators to change the number, such as: Setting a variable (ex. squareRoot = 5) Addition (A+B) ...
3
votes
6answers
2k views

print “Hello, world!” without using literals [closed]

Write a program that prints "Hello, world!" without using any kinds of literals. Don't use string literals, numeric literals, byte literals, char literals, etc. Default values are allowed in ...
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 ...
6
votes
5answers
297 views

Write biSp in point-free form using as few terms as possible

The Haskell function biSp has type signature ...
26
votes
12answers
4k views

Print the Golden Ratio

This was fun! However with only three digits, the fun was over way too soon. This challenge is similar, but we'll keep the fun going. The Challenge Print as many digits of the Golden Ratio φ as ...
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 ...
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 ...
13
votes
1answer
2k views

Duct tape can fix anything [closed]

Overview This challenge was inspired by this StackOverflow Meta post. In it, @hakre says: I've seen a project really written by Stackoverflow (a noob copies together from SO here and SO there), ...
62
votes
20answers
8k views

Hash collision: “NO” means “YES”

This Code Golf was inspired by the recent Daily WTF article You Can't Handle the True!, which features a string comparison written as: ...
-4
votes
4answers
802 views

Print “Hello World” in Ascii Art … without its characters [closed]

Your mission is to write a program that prints "Hello World!". Simple? The text must be human readable and should not be "|-| € |_ |_ 0 // 0 |? |_ |) \./" or something like that. The program ...
-2
votes
9answers
524 views

I challenge you to generate the following sequence [closed]

I challenge you to generate the following sequence till 100 terms through any programming language in shortest characters possible. The sequence is like this :- ...
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 ∪ ...
12
votes
7answers
4k views

Determine if a number is prime without using arithmetic [duplicate]

Write a program which determines if a given number is prime. The catch: No digits or arithmetical operators. This means: No digits from 0 to ...
2
votes
6answers
398 views

Format a US address

Your task is to format an address given in all lowercase to a friendlier format. Here's the catch, no regexes. Addresses will be given in the following format: ...
5
votes
1answer
817 views

Let us create a sonnet quine! [closed]

There are programs that will output its source code to standard output and do nothing else. They also access no external output. This type of program is known as a quine, and is a common code ...
15
votes
18answers
913 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: ...
16
votes
17answers
3k views

Calculate a tip

You and a friend walk into a bar. The bartender treats you well, so you decide to tip him. So you pull out your trusty pocket computer and write a quick program to calculate a tip for you since it has ...
11
votes
13answers
1k views

Point-free look and say sequence

You are too make a program that take an integer as the input and outputs the first what ever that number was of the look and say sequence. For example: ...
43
votes
52answers
8k views

Alphanumeric Hello World [closed]

Your goal is to write "Hello, World!" (minus the quotes). This is a popularity-contest, so most up votes wins. Code length will be used to break ties. Anything goes, as long as it is within the ...
14
votes
55answers
16k views

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

This is a really neat short challenge. Write a function or a procedure that takes two parameters, x and y and returns the ...
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 ...
57
votes
39answers
16k views

All Your Base Are Belong To Us (Restricted)

Input must not be required, and output must read "All your base are belong to us". Restrictions No external resources. Plus a minimum of two of the following: ...
15
votes
26answers
4k views

“Hello world!”, repeating each character n times [closed]

In your language of choice, write a program that outputs exactly Hello world!. Each character in your program must be repeated n times - you choose n. For example, ...
27
votes
9answers
3k views

Hello world! with NO repetition

In any programming language that existed before this question was asked, write a program (not a function) that outputs the characters Hello world! followed by a ...
21
votes
21answers
3k views

Hello world!!! Fibonacci distribution

Your program should output exactly: Hello world!!! with or without linefeed after. Your program should take no input. Sourcecode character distribution must be ...
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 ...
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 ...
19
votes
3answers
2k 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 ...
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: ...
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 ...