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
33
votes
69answers
3k views

Restricted mini challenges Cop's Thread

Robber's thread Your task as cops is to select three things: A programming language An OEIS sequence A byte set You are then to secretly write a program in that language that computes the nth term ...
85
votes
45answers
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. ...
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 ...
16
votes
4answers
552 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
509 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 ...
5
votes
1answer
252 views

ASCII Reverse Quine

Okay, so everyone is familiar with the ASCII-table, correct? I'd hope so. I've been going to that site for my asciitable reference for as long as I can remember needing one. We'll be doing some fun ...
25
votes
56answers
3k views

MacGyver's Toolbox [duplicate]

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 ...
6
votes
16answers
921 views

Emoticon numbers!

(related) Your challenge is to output the highest number you can. You can output as a number or as a string. You must output something that matches the regex ^\d+$,...
8
votes
1answer
329 views

How high can you count in different languages?

Based on How high can you count? let us give an advantage to the polyglot people. Challenge: Your task is to write as many programs / functions / snippets as you can, where each one outputs / prints ...
-4
votes
14answers
559 views

Count the number of “e”s in a string without using the letter “e” [closed]

Your code may not contain the letter "e", but must count the number of "e"s in the inputted string and output that as a number. Bonus points if you use a language that is not a codegolf language and a ...
0
votes
1answer
143 views

Four-Four-Four-Four! [duplicate]

This is the sequel to one of my previous challenges, Three-Three-Three! Write a program (or function, or snippet) that takes no input and produces an output according to the following four Conditions....
6
votes
12answers
518 views

Multiply using ***Real*** numbers

Inspired by a restriction on What do you get when you multiply 6 by 9? (42) By order of the President, we are no longer permitted to use confusing fake numbers (i.e. numbers other than integers from ...
157
votes
63answers
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 ...
23
votes
28answers
3k views

Take a stand against long lines

Recently, someone proposed more stringent limits for Python's default line length: Clearly, no program should ever use more than 80 characters per line, for a whole host of reasons. First and ...
-2
votes
10answers
226 views

Trim a String without Builtins [closed]

Given text, remove leading and trailing whitespace (spaces, tabs, and newlines). Alternate title: Implement your own string trimming. Input ASCII text (printable + spaces, tabs (...
28
votes
1answer
693 views

Unrestricted Languages

One of my favorite types of challenges on this site are restricted-source challenges. These challenges impose a computer tractable restriction that the sources of potential answers must pass. I like ...
42
votes
28answers
3k views

Surprise Party for Brain-Flak

This question is part of a series Brain-flak Birthday challenges designed to celebrate Brain-Flak's first Birthday. You can find more information about Brain-Flak's Birthday here. Today is Brain-Flak'...
1
vote
11answers
748 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 ...
-6
votes
12answers
154 views

Restricted powers of two [closed]

Challenge Given a number x, output the first x powers of two, starting with 2¹ (2). Example ...
13
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 ...
45
votes
1answer
1k views

Cyclic Levenquine

Background As most PPCG regulars will know, a quine is a program which outputs its own source code when run; and the Levenshtein distance between two strings is the minimum number of insertions, ...
25
votes
42answers
2k views

Answer-Chaining Fibonacci

(Inspired by ASCII's 95 Characters...95 Movie Quotes) The Challenge Given input n, output the nth Fibonacci number. You ...
8
votes
15answers
2k views

plz send teh codez!

Note to Moderators and editors: This post's title is for effect and should not be changed. The misspelling is intentional and part of the challenge. Backstory The (stereo)typical bad SO question ...
-1
votes
5answers
214 views

No Singles Allowed [closed]

This is a fairly simple challenge. Write a program that computes the distance between two points on a 2D plane. However, you can't use any functions or operators (referred to here as symbols) that ...
8
votes
5answers
281 views

2016 Time Capsule String: Coverage

Consider the 74 characters from the 2016 time capsule string (note the leading space): ...
24
votes
3answers
1k views

Hello World - but alphabetically

This challenge sounds too simple to not already exist, so let me know if it is a duplicate. The task Print Hello, world! The rules Your code has to be in "byte ...
13
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 ...
1
vote
1answer
455 views

Bowl a rectangular quine

Code-Bowling Quine Challenge You must bowl a quine following the rules of code bowling and quines but the source code must be in the shape of a rectangle (details specified below) Quine Quines ...
32
votes
16answers
3k views

This is the sort of challenge that bytes

I need to stop thinking of punny names Your task is to create as many snippets (programs that have input and output built-in), functions or full programs as possible that sorts whatever your language'...
54
votes
30answers
9k views

Output the text “Code Bowling”

Code-Bowling You've been hired by Brunswick Bowling to create a simple program to output the text Code Bowling on their monitors. This company is worth a pretty ...
20
votes
41answers
3k views

Robbers: Crack the regex - Make a snake

This is the robber's thread. The cop's thread is here. A snake matrix is a square matrix that follows this pattern: 3-by-3: 1 2 3 6 5 4 7 8 9 and 4-by-4: ...
28
votes
18answers
3k views

Disconnect 4 bits

Your task: given an input string, determine whether the binary representation of that string does not have 4 1s or 0s in a row, ...
28
votes
12answers
3k views

Write self-validating code

Write code that takes a string as input, and outputs a truthy or falsey value depending on whether or not the string follows these rules: If you stack each character on top of each other, convert to ...
24
votes
16answers
2k views

Running Merge Conflict

When using a tool such as git to merge two files, a conflict could be detected and added to the result of the merge. A merge of these two files: my file: ...
44
votes
67answers
13k views

Hack into a Lottery

You've recently made an account on a dodgy gambling site, where for a fee of 25 dollars, they will pay you back a random amount between 0 and 50 dollars. After getting around 5 dollars twice, you ...
108
votes
51answers
15k 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 ...
103
votes
66answers
26k views

I'm a palindrome. Are you?

There have been a couple of previous attempts to ask this question, but neither conforms to modern standards on this site. Per discussion on Meta, I'm reposting it in a way that allows for fair ...
1
vote
5answers
359 views

Multiply without multiplying, without loops either [closed]

Make a function, method, program or routine that will accept two interger parameters (say x and y) and the total of the two ...
9
votes
4answers
432 views

Quining, but with Windows files!

Write a quine, that when run, creates itself in the current directory, in a source file named itself. We will be using Windows in this, so the file name (and therefore quine) must have the following ...
2
votes
7answers
854 views

Kolmogorov Complexity Meta Golfer

Mike Bufardeci (Pyth) - 175 bytes Leo (Retina) - 175 bytes devRicher (Lua) - 182 bytes Peter Taylor (CJam) - Waiting for clarification Lyth (C++11) - Waiting for clarification Edit: Several changes ...
66
votes
80answers
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, ...
32
votes
3answers
3k views

OOP: Overlapping Oriented Programming

One of the lesser known programming paradigms which seems rather fitting for code golfing is Overlapping Oriented Programming (OOP) *. When writing partly identical code, many bytes can be saved by ...
45
votes
129answers
14k 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
32answers
1k views

A prime test that's LITERALLY prime

Write a program that will test the primality of a specified number, and give the output as a Boolean value (True is prime). Your prime test can (but doesn't have to) be valid for the number 1. Here'...
29
votes
9answers
2k views

Display OEIS sequences

The On-Line Encyclopedia of Integer Sequences (OEIS) is an online database of integer sequences. It contains nearly 280000 sequences of mathematical interest. Examples of sequences: positive ...
55
votes
20answers
8k views

Exit Code Golfing

Inspired by this default for IO. The Task Write a program that, given an input integer x between 0 and 255, crashes with exit code ...
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: ...
36
votes
11answers
2k views

Different tasks, same characters

In this challenge, you need to solve 4 different tasks using the same set of characters. You can rearrange the characters, but you can't add or remove characters. The winner will be the submission ...
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 ...
28
votes
11answers
1k views

2016 Time Capsule String: Climb The Integer Ladder

Using the 74 characters from the 2016 time capsule string H@~*^)$.`~+1A|Q)p~`\Z!IQ~e:O.~@``#|9@)Tf\eT`=(!``|`~!y!`) Q~$x.4|m4~~&!L{% write N code snippets ...