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
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 ...
18
votes
12answers
608 views

Almost Illegal Strings, Mark II (Cops)

Edit 2020-11-06: This challenge has been edited with new provisions to encourage participation. The edits have been bolded for emphasis. Welcome to a cops and robbers version of Find an Illegal ...
17
votes
40answers
3k views

The ASCII character countdown!

Since this is a answer-chaining challenge, you might want to sort answers by oldest. Your task is simple: Choose any printable ASCII character that's not chosen in the previous answers. And then, you ...
17
votes
10answers
2k views

The Symbols vs. The Letters

The Symbols vs. The Letters The ASCII characters have been divided once again! Your sets are The Letters and The Symbols. The Letters ...
17
votes
13answers
1k views

Appearing a unique number of times

Your task is to write a program or function that takes as input a list of positive integers and determines if there are any two integers in the list, that both appear the same number of times. For ...
17
votes
3answers
2k views

How divisible are you?

You are to create a program which, when given a positive integer \$n\$, outputs a second program. This second program, when run, must take a second positive integer \$x\$ and output one of two ...
17
votes
2answers
833 views

Find out if this a valid Stack Cats program, in Stack Cats style!

Background Stack Cats is a reversible esoteric language made by Martin Ender. Each command in Stack Cats is either the inverse of itself (represented as a symmetric character, such as ...
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 ...
16
votes
20answers
3k views

And and… and. And.?

Introduction: Inspired by the Puzzling-stackexchange post with the same name, which I've answered four years ago: Can you create a perfectly valid English sentence, which makes perfect sense, but ...
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 ...
16
votes
6answers
463 views

Princely Prefix by a Program in Pattern

You should write a program or function which outputs or returns as much of Chapter I of The Little Prince as it can. Your program or function has to be an M-by-N block of code containing only ...
16
votes
13answers
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: ...
16
votes
5answers
641 views

Quining a Pristine World

This challenge is based off of Helka Homba's question Programming a Pristine World. From that question, the definition of a pristine program is: Let's define a pristine program as a program that ...
16
votes
3answers
555 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 ...
16
votes
1answer
743 views

Every prime bit must alternate

A program is bit primed if bits in prime positions must alternate between zero and one, starting with one. For example, this is a template for a bit primed program with [0..47] bits. ...
16
votes
5answers
689 views

Unwise bit operations

I like to golf in dc, but I'm sometimes frustrated because dc doesn't have bitwise operations. Challenge Provide four named ...
15
votes
57answers
18k 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 ...
15
votes
62answers
2k views

Restricted mini challenges Robbers Thread

Cops thread Your task as robbers is to find cops solutions and write a program in the language provided that computes the nth term of the sequence using only the bytes in the provided set. The ...
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, ...
15
votes
15answers
690 views

Restricted-source polyglot string

Your goal is to write a program that prints the string abc in two languages. However, while the full code will print abc in one ...
15
votes
15answers
1k views

Find five friends to eat chicken with Paul

Paul is one of your Belgian acquaintances, and he would like you to create a program that outputs at least one of the following five strings: ...
15
votes
18answers
961 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: ...
15
votes
6answers
753 views

Print strings without sharing characters

Edit: Allowed to reuse whitespaces. Your task is to write n programs (or functions, or bodies of functions without using parameters or the function names) in the same language. The kth program ...
15
votes
4answers
896 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 ...
14
votes
14answers
1k views

Rearrangeable Code Bowling

Code-Bowling Challenge Write a program or function that produces the same output, no matter how you re-arrange the source code. (Output can't be an error) Pangram Scoring Your score is the amount ...
14
votes
8answers
2k views

My source is in order, is yours?

Your challenge is to write a program, function, etc. that calculates if the passed string is "in order". That means that the characters of the string have character codes that are in order from ...
14
votes
9answers
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) ...
14
votes
1answer
551 views

Is everything in order?

Challenge: Input: a string, consisting of only printable ASCII characters Output: a truthy/falsey value whether its characters are in alphabetical order (based on their UTF-8 unicode values), from any ...
13
votes
23answers
2k views

Palindromize this string! [duplicate]

Your task is to palindromize a string as follows: Take the string. abcde Reverse it. edcba Remove the first letter. <...
13
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: ...
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 ...
13
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 ...
13
votes
15answers
11k 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) ...
13
votes
2answers
607 views

Tips for restricted source in Haskell

I tested the waters on this sort of question with python, but now I get to the real question I want to ask. restricted-source challenges are uniquely rewarding in Haskell because of Haskell's strict ...
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), ...
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 ...
12
votes
22answers
2k views

Sum in 2540 sums

This is my attempt to pair code-shuffleboard with code-golf. You need to write a full program or function that sums all codepoints of the input string. If there is no input, you can output any number,...
12
votes
23answers
3k 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 ...
12
votes
14answers
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: ...
12
votes
10answers
3k views

Golfing Emoticons

Introduction Your challenge today (inspired by this challenge) is to write a number of snippets, functions or full programs each that output various ascii emoticons, without reusing characters. ...
12
votes
10answers
827 views

Kolmogorov Flexibility. A.K.A. Sale! \$38\%\$ Off All Codegolf While Stocks Last!

This is a restricted-source, kolmogorov-complexity, code-golf challenge to produce a fixed output with no input. The output format, however, is flexible - it may be printed to standard out, printed to ...
12
votes
5answers
865 views

Raise to the Power

Challenge Challenge is writing a program that takes a positive numbers a and a nonzero number b and outputs ...
12
votes
5answers
627 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 ...
11
votes
8answers
1k views

Generate a Brainf_ck program that outputs a string of given length

Your friend is trying to break into a vault that has a peculiar locking system: it requires a certain number of gentle knocks in a particular spot. Your friend discovered the number (which is in the ...
11
votes
9answers
510 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: ...
11
votes
23answers
1k 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 ...
11
votes
6answers
786 views

Invert a Quine!

We all know what a quine is. An inverted quine is a non-empty program that prints the inverse of its source code without reading its source code, and consists solely of printable-ASCII characters (...
11
votes
4answers
892 views

Encoding an URL in brainfuck

Inspired by this question, your goal today is to encode an URL in brainfuck. My browser has been hacked! The location bar has been turned into a brainfuck interpreter. I need a program that turns an ...
11
votes
3answers
1k views

C# is the Main problem

This programming puzzle is inspired by another question which has been asked here yesterday but which was deleted by the author... The challenge: Create an executable binary (Windows .EXE or Linux ...
11
votes
0answers
206 views

“Could you repeat yourself?” aka Could a doubled character solution exist in JavaScript? [duplicate]

This thinking exercise is inspired from Super Chafouin's question "Just Repeat Yourself" in which the phrase "Do not repeat yourself!" had to be outputted using code that was basically a series of ...

1 2 3
4
5
7