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.

23
votes
28answers
2k 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
213 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 (...
26
votes
1answer
648 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
2k 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'...
-3
votes
7answers
405 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
151 views

Restricted powers of two [closed]

Challenge Given a number x, output the first x powers of two, starting with 2¹ (2). Example ...
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 ...
43
votes
1answer
947 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
41answers
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 ...
9
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
212 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
273 views

2016 Time Capsule String: Coverage

Consider the 74 characters from the 2016 time capsule string (note the leading space): ...
23
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
435 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 ...
31
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'...
55
votes
30answers
8k 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 ...
21
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: ...
45
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 ...
102
votes
48answers
12k 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
67answers
25k 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
329 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 ...
10
votes
4answers
424 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
818 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 ...
64
votes
74answers
6k 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 ...
37
votes
114answers
12k 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 ...
21
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'...
28
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 ...
53
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 ...
47
votes
38answers
6k 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 ...
71
votes
27answers
6k views

2016 Time Capsule String: How Versatile Is Your Language?

About a year ago on Dec 31, 2015, I had the idea that: We should make a time capsule string. Everybody gets to add one character and next new years we'll see who can make the best program out of ...
41
votes
15answers
5k views

Determine whether a number is 2017-friable without primes in your source code

Out of all the years I've been making this challenge, 2017 is the first year that's been a prime number. So the question will be about prime numbers and their properties. Your task is to produce a ...
26
votes
2answers
1k views

Fastest Mini-Flak Quine

Mini-Flak is a subset of the Brain-Flak language, where the <>, <...> and [] ...
16
votes
1answer
725 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. ...
19
votes
6answers
669 views

Count the characters - bit by bit!

The simple part: Given an input string containing only printable ASCII-characters (space - tilde), count the number of occurrences of each character and return the result on any convenient format. The ...
5
votes
4answers
594 views

The Essential™ (comment-free) Convenient Palindromic Quine Golf

A program is "conveniently palindromic" if it is equal to the string derived when its reverse has all its parentheses (()), brackets (...
-8
votes
13answers
588 views

Count up from 0 to 2017 without numbers in your source

This question was profoundly inspired by Joe Z's question. But, with a twist... So, now that it's almost 2017, it's time for a code question involving the number 2017. Your task is to make a ...
20
votes
27answers
2k views

8 ought to become Infinity [closed]

Let's take a look on a typical loop, which usually performs 8 iterations: for (int x=0; x<8; ++x); You have to make it infinite! It's a popularity-contest ...
46
votes
63answers
5k views

Depalindromize this string!

Given a palindrome generated according to this challenge, depalindromize it. Test cases ...
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. <...
11
votes
3answers
946 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 ...
10
votes
0answers
196 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 ...
-8
votes
11answers
356 views

Outputting x to y

Challenge You must choose one number x (y = x + 9) and create ten unique programs which each print out one of the numbers in ...