Stack Exchange Network

Stack Exchange network consists of 174 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.

-7
votes
2answers
159 views

Colors weave into a spire of flames

https://www.youtube.com/watch?v=6vAhPeqlODg Ok—jig's up—this one's only related to smash in name, but it'll give you something to burn your time with while you wait 'til December 7th Given a color ...
3
votes
14answers
445 views

Toasty, Burnt, Brûlée!

It turns out that my toaster is a tad broken. It lost WiFi (You know, it's one of those newfangled smart toasters), and its been going bonkers! Since it no longer works, I've been having to hack into ...
22
votes
15answers
2k views

A Semi-palindrome Puzzle

An palindrome is a word that is its own reverse. Now there are some words that might look like palindromes but are not. For example consider the word sheesh, <...
-4
votes
3answers
289 views

Without using numbers, Calculate Pi [duplicate]

Inspired by Nicola Sap's Challenge Goal Your challenge is to simply produce π with 232-1 digits. However today's twist, like the title implies, is to produce it without using any numbers or any π ...
36
votes
16answers
3k views

A Chiral Puzzle

A shape is chiral if no amount of rotation can make it look like it's mirror image. In this puzzle we will be writing chiral computer programs. For this puzzle we will think of a program as a ...
198
votes
99answers
29k views

Without using numbers, get the highest salary you can. But don't exaggerate!

As I'm applying for some jobs whose job advert doesn't state the salary, I imagined a particularly evil interviewer that would give the candidate the possibility to decide their own salary ...by "...
6
votes
6answers
850 views

Lucas and Fibonacci are in pair

Influenced by Non-discriminating Programming, I made up an idea of a similar challenge. Here, we say a string is a Lucas string if the number of appearances of each character is a Lucas number (2, 1, ...
30
votes
3answers
4k views

Primality testing formula

Your goal is to determine whether a given number n is prime in the fewest bytes. But, your code must be a single Python 2 expression on numbers consisting of only ...
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. ...
17
votes
12answers
2k views

In for a bumpy ride

Your task is to write a computer program or function that takes a list of positive integers of at least length 2 and determines if they are a "zigzag". A sequence is a zigzag if and only if the ...
25
votes
25answers
2k views

Detect Perfect Pairings

Let's have a function \$f\$ that takes a string and removes all pairs of adjacent identical characters. For example \$f(a\color{red}{bb}ba\color{red}{cc}) = aba\$ Note that when two pairs overlap ...
19
votes
19answers
2k views

Detect Rectangular Text with Rectangular Code

Given a string of printable ASCII text (including newlines and spaces) that contains at least one character that is neither a newline nor a space, output a truthy value if the string is rectangular, ...
21
votes
10answers
1k views

Write a Quine Suite

We've had a lot of quine challenges, but a lot of the quine formats are similar, lets create some variance in our quines. Your task is to create a selection of programs in the same language (at least ...
76
votes
21answers
6k views

Pristine and Unique Code Bowling

Your challenge is simple: write as long of a pristine program as possible in the language of your choice using only unique bytes. (The full definition of a pristine program, copied from that link, is ...
6
votes
20answers
3k views

Distance between the Sun and the nth planet

Challenge Predict the distance between the Sun and the nth planet when using any formula that gives the same result as the Titius–Bode law: d=(3*2^n+4)/10. BUT ...
47
votes
133answers
6k views

Output your Score!

Challenge: The concept is simple enough: write a full program to output its own code golf score! Output should only be the byte count of your program and a trailing ...
16
votes
2answers
784 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 ...
47
votes
31answers
4k views

Does it Lead or Follow?

In this challenge you are to write a program or function, that takes a string as input and outputs one of two possible values. We will call one of these values truthy and one falsy. They do not need ...
10
votes
6answers
402 views

Self-Validating Triangular Checkerboard Program

A checkerboard program is a program where each individual character's ordinal value alternates from even to odd, excluding the line terminator (which can be any standard line-endings). A triangular ...
32
votes
5answers
1k views

Left Hand vs. Right Hand — Typists Challenge

Your task is to pit each side of the keyboard against each other and build two programs, in the same language, one using only keys on the left-hand side of a standard keyboard that outputs ...
7
votes
2answers
645 views

Creating a function over multiple lines

I'm attempting to create a function over multiple lines. Parameters of the challenge: Function returns 'barbarian' Only 2 characters per line 40 lines maximum. I keep trying to use a fat arrow to ...
36
votes
38answers
4k views

Hast Thou Slain the Jabberwock?

Your task is to output the exact string The Jabberwocky without taking input. Normal rules for input and output apply, so both functions and programs are ...
71
votes
34answers
11k views

Non-discriminating Programming

We say a string is non-discriminating if each of the string's characters appears the same number of times and at least twice. Examples "aa!1 1 !a !1" is non-...
11
votes
6answers
723 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 (...
-8
votes
29answers
528 views

Reversible program

Objective Write a program that outputs some printable ASCII characters. The trick is that if the program is reversed byte-by-byte, it must output the same thing in the reverse order, byte-by-byte, ...
33
votes
8answers
2k views

No co-prime neighbors

Given a list of positive integers, output whether every adjacent pair of integers in it shares a prime factor. In other words, output truthy if and only if no two neighboring integers in the list are ...
28
votes
12answers
4k views

Hello, World! with semi-common characters

As some of you may know, to get a language onto Dennis's wonderful Try It Online!, a Hello, World! program is required. Recently, Dennis pushed up a way to load these programs from the website. Here ...
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 ...
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 ...
67
votes
36answers
6k 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. ...
33
votes
20answers
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 ...
15
votes
4answers
499 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 ...
14
votes
2answers
383 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
229 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 ...
5
votes
16answers
901 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
298 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
532 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
134 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....
5
votes
10answers
418 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 ...
148
votes
56answers
21k 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
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
203 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
641 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 ...
40
votes
27answers
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
397 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
143 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
890 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 ...