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
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
9k 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
57answers
17k 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 ...
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
8answers
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 ...
80
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 ...
115
votes
73answers
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 ...
20
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: ...
582
votes
276answers
213k 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 ...
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
1answer
476 views

Bitwise GCD Challenge

Write the shortest iterative function to find gcd of two numbers (assume 32 bit numbers). Rules: Arithmetic, Comparison and Logical Operators are not allowed (except equality comparison (...
7
votes
5answers
660 views

Shortest Mirror Quine Challenge [closed]

Find the shortest mirror quine in a language of your choice. A mirror quine is a quine whose source code is equal to the reverse of its own source code. Note: 1) Length of source code should be ...
14
votes
4answers
809 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 ...
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
14answers
780 views

Sort, with your hands tied behind your back [closed]

The problem is very simple: write a program that accepts a single unsigned integer from the command line, and prints out that many random numbers on the standard output, in ascending order. For ...
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 ...
72
votes
111answers
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-...
5
votes
13answers
862 views

Generate the list [1, 0, -1, 0, 1, 0, -1, 0, …] [closed]

In the spirit of a question on math.se: given an integer n, return the integer in position n of the sequence [1, 0, -1, 0, 1, 0, ...
31
votes
66answers
6k views

Determine if a number is divisible by 13 (without using 13 itself) [closed]

Your challenge, should you choose to accept it, is to create a function or a program that outputs "yes" if a given number is divisible by 13 and outputs "no" if it isn't. Rules: - You're not allowed ...
24
votes
59answers
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 ...
22
votes
25answers
7k 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 ...
14
votes
17answers
4k views

Shuffle a deck without local variables [closed]

The object of this puzzle is to take a deck of 52 cards and shuffle it so that each card is in a random position. Given: An array, deck, of 52 distinct integers ...
78
votes
101answers
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/...
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, ...
25
votes
11answers
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 ...
6
votes
8answers
422 views

Remainder When N divided by 2^M

Write the shortest code to find the remainder when an input number N is divided by 2^M. You cannot use /,* and % operator. ...
123
votes
123answers
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 ...
25
votes
18answers
9k views

Print 1 to 1000 in C++ without semi-colons

Following this popular question, present your solution which prints the numbers 1 to 1000 (all of them, not the string "1 to 1000" verbatim or something funny) in C++ without using any semi-colons. ...
50
votes
41answers
15k views

Obfuscated FizzBuzz Golf [closed]

Create the shortest possible obfuscated FizzBuzz implementation. To be considered obfuscated, it should satisfy at least one of the following: Does not contain any of the words "Fizz", "Buzz", or "...