text stringlengths 180 608k |
|---|
[Question]
[
Make a Quine.
Seems easy right? Well this quine must output itself plus its first character, which then outputs itself plus its second character, and so on.
**This way the quine should in several generations output two copies.**
Example:
Lets your code be `x`. Running it should output `x + x[:1]`. Runn... |
[Question]
[
*Inspired by [this](https://chat.stackexchange.com/transcript/message/49893872#49893872) chat mini-challenge.*
Given a string as input (ASCII printable characters only), output the string with the letters "raining" down. Each letter must be a random number of lines downward (random between `0` and the ... |
[Question]
[
# A Fragile Quine
A fragile quine is a quine that satisfies the property of having each substring made by removing a single character, when evaluated, produces an error.
For example. If your program `asdf` is a quine, then for it to be fragile, the following programs must error:
```
sdf
adf
asf
asd
```... |
[Question]
[
If you've ever learned about primes in math class, you've probably have had to, at one point, determine if a number is prime. You've probably messed up while you were still learning them, for example, mistaking 39 for a prime. Well, not to worry, as 39 is a semiprime, i.e., that it is the product of tw... |
[Question]
[
Given an input string consisting of only letters, return the step-size that results in the minimum amount of steps that are needed to visit all the letters in order over a wrapping alphabet, starting at any letter.
For example, take the word, `dog`. If we use a step-size of 1, we end up with:
```
defgh... |
[Question]
[
Seahorses, of course, need shoes. However, a seahorse, having just one tail, needs just one shoe. Unfortunately, the shoes only come in pairs. Money is tight for the seahorse government, so they need to buy as few pairs as possible. Each seahorse has a shoe size *x* where *x* is a positive integer. How... |
[Question]
[
Given a positive number *n*, output all distinct multiplicative partitions of *n* in any convenient format.
A multiplicative partition of *n* is a set of integers, all greater than one, such that their product is *n*. For example, 20 has the following distinct multiplicative partitions:
```
2 * 2 * 5
2... |
[Question]
[
Today, November 11, 2015, is [Veterans Day](https://en.wikipedia.org/wiki/Veterans_Day) in the United States. "[Taps](https://en.wikipedia.org/wiki/Taps)" is the [bugle call](http://www.music.army.mil/music/buglecalls/taps.asp) played at U.S. military funerals:
(["Taps" on SoundCloud](http://soundcloud... |
[Question]
[
Sometimes when I'm doodling, I draw a rectangle, start with a diagonal from one of the corners, and then just trace out a line by "reflecting" it whenever I hit a side of the rectangle. I continue with this until I hit another corner of the rectangle (and hope that the aspect ratio of my rectangle was ... |
[Question]
[
# Heatmaps
Consider a rectangular room, on whose ceiling we have a thermal camera pointing downward. In the room, there are some number of *heat sources* of intensity `1-9`, the background temperature being `0`. The heat dissipates from each source, dropping by one unit per (non-diagonal) step. For exa... |
[Question]
[
The [Hilbert curve](http://en.wikipedia.org/wiki/Hilbert_curve) is a space filling fractal that can be represented as a [Lindenmayer system](http://en.wikipedia.org/wiki/L-system) with successive generations that look like this:

Thanks to <http:... |
[Question]
[
# Programmin' Pac-Man
## Setting
You play as Pac-Man. You want to collect pellets, fruit, and power pellets before anybody else, all while avoiding ghosts.
## Rules
1. Every valid Pac-Man will be in a single maze. The player with the highest cumulative score after 10 games will win.
2. A game is over w... |
[Question]
[
# Please note: *this is a* [restricted-source](/questions/tagged/restricted-source "show questions tagged 'restricted-source'") *challenge — see details below!*
Each natural number \$n\$ has 10 *faces*: its decimal representations in bases \$1\$ through to \$10\$. For example, the 10 faces of \$12\$ ar... |
[Question]
[
## Background
I have a bunch of old and grainy black-and-white images.
Some of them depict vines climbing on a wall, others don't – your task is to classify them for me.
## Input and output
Your input is a rectangular 2D array of bits **A**, given in any convenient format.
It will not be empty, but it'... |
[Question]
[
In the ASCII art world, there is water, hash walls and letter mechanisms.
You are in a room made up of hash walls (`#` signs):
```
#######
# #
# #
# #
# ### #
# #
#######
```
You install an S water source (`S` sign) and an E water tank (`E` sign) which can receive water from any directi... |
[Question]
[
# Background
OEIS sequence [A272573](https://oeis.org/A272573) describes a spiral on a hexagonal grid as follows:
>
> Start a spiral of numbers on a hexagonal tiling, with the initial hexagon as a(1) = 1. a(n) is the smallest positive integer not equal to or previously adjacent to its neighbors.
>
> ... |
[Question]
[
**Introduction**
This is one is pretty straightforward. We will be drawing a snake in ascii. This was inspired by that old snake game where you have to collect the fruit and you continuously grow.
**Definition**
Given a positive integer N that represents the snake's length, draw a snake so that it has ... |
[Question]
[
Consider the following alphabetically sorted list of words:
```
balderdash
ballet
balloonfish
balloonist
ballot
brooding
broom
```
All of the words start with `b`, and the first 5 start with `bal`. If we just look at the first 2 words:
```
balderdash
ballet
```
we could write instead:
```
balderdash
... |
[Question]
[
[BS](http://en.wikipedia.org/wiki/Cheat_%28game%29) is a card game where the object of the game is to lose all of your cards.
A game consists of four players and a 52-card deck. Each player is randomly dealt 13 cards. Normally, cards are labeled 2 - 10, Ace, Jack, Queen, King, but for simplicity, the c... |
[Question]
[
## Introduction
Santa has too many names to process, and needs your help! He needs you to write a program or a function, which outputs `nice`, `naughty`, `very naughty` or `very very naughty`. To determine how nice or naughty someone is, Santa had developed an algorithm:
**Nice** ([division](/questions... |
[Question]
[
# Background
Recognizing primality seems like a poor fit for (artificial) neural networks. However, the [universal approximation theorem](https://en.wikipedia.org/wiki/Universal_approximation_theorem) states that neural networks can approximate any continuous function, so in particular it should be pos... |
[Question]
[
I was at a friend's house for dinner and they suggested the idea of a "Prime-factor vector space". In this space the positive integers are expressed as a vector such that the **n**th element in the vector is the number of times the **n**th prime divides the number. (Note that this means that our vector... |
[Question]
[
Poker hands are ranked from best to worst as follows:
1. Straight flush - five cards of sequential rank, all of the same suit
2. Four of a kind - four cards of the same rank and one card of another rank
3. Full house - three cards of one rank and two cards of another rank
4. Flush - five cards all of t... |
[Question]
[
Given a description of the base state of a recursive ASCII pattern, output an expanded state somewhere along the recursion steps.
More specifically: Let the following be an example:
```
##..
##..
..__
..__
```
Where `#` is filled, `.` is empty, and `_` is recursive.
This describes a pattern wherein the... |
[Question]
[
## Input:
1. You get a series of integers (fed via stdin or prompt).
2. Every pair of integers in this series represents a building's
WIDTH [valid range: 1..10] and HEIGHT [valid range: 0..10]
3. Assume input to be well-formed.
*Sample input (the second line is for demonstration purposes only):*
```
1 ... |
[Question]
[
In this challenge you will be creating an image preview compression algorithm. It's goal is to
reduce an arbitrary image file to a 4 KiB preview image, that can be used to quickly identify images
with very little bandwidth.
You must write two programs (or one combined program): a compressor and a decom... |
[Question]
[
So, now that it's 2015, and [a bunch of answers](https://codegolf.stackexchange.com/a/17010/7110) [from last year's puzzle](https://codegolf.stackexchange.com/a/17021/7110) [are now starting to](https://codegolf.stackexchange.com/a/17046/7110) [produce invalid output](https://codegolf.stackexchange.com... |
[Question]
[
[Magic: the Gathering](https://en.wikipedia.org/wiki/Magic:_The_Gathering) is a trading card game where, among other things, players play cards representing creatures, which can then attack the other player, or defend against the other player's attacks by blocking.
In this code-golf challenge, your pro... |
[Question]
[
Cubes can be made of six squares as sides. But you could also fold three 2x1 rectangles in half and glue them together to form a cube. Now in this challenge you get a set of pieces which are each made from squares, and you have to determine whether you can choose pieces to form a unit cube. Not all of ... |
[Question]
[
One of my favorite types of challenges on this site are [restricted-source](/questions/tagged/restricted-source "show questions tagged 'restricted-source'") challenges. These challenges impose a computer tractable restriction that the sources of potential answers must pass. I like these challenges so m... |
[Question]
[
## Background
A typist comes home wfter some riugh drinkinh and realizes thag an importsnt letter still needs to be wtitten. To make sure he vets the text correct, he writes the text character bh vjaracter t0 be sure of 6he resuly. However, he dtill manages t0 miss some ofbthe keys.
Yout task is to wri... |
[Question]
[
It's the final sprint... and half your team is off ill. You're working late, just making your last commit for the day, looking forward to... why have the lights turned off? I don't remember the security guy coming around... oh no! I left my keys at home!
As the horror of the situation sinks in, you dec... |
[Question]
[
Once upon a time, I was reading this question/answer on Quora
[Are there really programmers with computer science degrees who cannot pass the FizzBuzz test](http://www.quora.com/Are-there-really-programmers-with-computer-science-degrees-who-cannot-pass-the-FizzBuzz-test#)
This code is given as the obvi... |
[Question]
[
**Input:** Two decimal integers. These can be given to the code in standard input, as arguments to the program or function, or as a list.
**Output:** Their product, as a decimal integer. For example, the input `5 16` would lead to the output `80`.
**Restrictions:** No standard loopholes please. This is... |
[Question]
[
## Challenge
Let's have a list `L` of `n` elements. The task is to swap every two elements in this list.
## Constrains
* the list `L` has at least two elements
* size of the list `L` is a multiple of two (i.e. number of elements is even)
### Example
* input: `[1,2,3,4,5,6]`
* output: `[2,1,4,3,6,5]`
* ... |
[Question]
[
**Closed**. This question needs to be more [focused](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Update the question so it focuses on one problem only by [editing this post](/posts/19050/edit).
Closed 6 years ago.
[Improve this question](/p... |
[Question]
[
**The Challenge**
Print a nice Christmas tree with it's own star at the top using the shortest code possible. The tree star is an asterisk (`*`) and the tree body is made out of `0` The tree must be 10 rows high. Every row should be properly indented in the way that the previous row are centered over t... |
[Question]
[
**Closed**. This question needs to be more [focused](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Update the question so it focuses on one problem only by [editing this post](/posts/8859/edit).
Closed 7 years ago.
[Improve this question](/po... |
[Question]
[
*It's one of [these](https://codegolf.stackexchange.com/questions/132558/i-double-the-source-you-double-the-output) again :D*
Your task, if you wish to accept it, is to write a program/function (**without any uppercase letters**) that outputs/returns its string input/argument. The tricky part is that i... |
[Question]
[
# The Challenge
It's quite simple really, sort a list of numbers.
# Details
You must sort a list of numbers in ascending order, without using any built-in sorting functions/libraries/etc (i.e. `list.sort()` in Python).
Input/output can be done in any method you choose, as long as it is human readable.... |
[Question]
[
Write a program fragment so that, when repeated N times it prints the Nth Fibonacci number. For example, if your program is `print(x)` then:
* `print(x)` should print `1`
* `print(x)print(x)` should print `1`
* `print(x)print(x)print(x)` should print `2`
* `print(x)print(x)print(x)print(x)` should prin... |
[Question]
[
Your task is to write a program, function, or snippet that will output one value if run forward, and another if run backward. The program must run without errors.
The output can be any two distinct values, of the same data type. For example, `1` and `3`, `true` and `false`, or `'t'` and `'f'`. In langu... |
[Question]
[
The goal of this code-golf is to create a code that lets the user input an ASCII string (contains only [printable ASCII characters](https://en.wikipedia.org/wiki/ASCII#Printable_characters)), and your program outputs the lower-case variant of this string.
**Important: you are NOT allowed to use a built... |
[Question]
[
For this challenge, submissions should be a program or function shaped like a right triangle, which produces a right triangle of the same size.
**What is a right triangle?**
For this challenge, a right triangle consists of 1 or more lines, each containing a number of characters (assume all non-newline ... |
[Question]
[
# The Program
You are given two strings, **A** and **B**. **A** is the current position at which your timer is at, and **B** is the position at which your timer will stop. Both strings are in the format **m:ss**. You must write a program that determines the amount of time left which should also be form... |
[Question]
[
**The Challenge**
In as few characters as possible, find the value of \$i^n\$, given \$n\$, a positive integer greater than 0. This should be outputted as a String.
For those that don't know, \$i\$ is defined such that \$i^2=-1\$. So:
* \$i^1=i\$
* \$i^2=-1\$
* \$i^3=-i\$
* \$i^4=1\$
This then repeats.... |
[Question]
[
Your task is to create a program that prints "Greetings, Planet!" exactly to the console. Seems simple enough, right? Well, here's the trick. The code must be a palindrome, meaning it reads from right to left the same as in left to right.
Standard loopholes are ***NOT*** allowed.
[Answer]
# [///](... |
[Question]
[
## The Challenge
Given a string, output the text in the shape of a square.
You can assume that the text will always fit in a [square](https://oeis.org/A000290), and that it will never be an empty string.
You can also assume it will never have newlines.
### Example
```
Input:
Hi, world
Output:
Hi,
wo
r... |
[Question]
[
**Task**
Read in a possibly infinite text stream or file, outputting its contents until the word `hello` has been output, abiding to the following rules.
* Once `hello` has been output, your code should quit immediately. It should not wait for a newline for example.
* Your code should output as it goes... |
[Question]
[
## Introduction:
Although we have a lot of challenges where swapping two items in a list is a subtask, like [Single swaps of an array](https://codegolf.stackexchange.com/q/152283/52210); [Swap to Sort an Array](https://codegolf.stackexchange.com/q/197536/52210); [\$n\$ swaps into a nop](https://codegol... |
[Question]
[
Write a piece of code that takes a string as input, and outputs a piece of code in the **same language** that, when run, will output the initial input string.
It must be able to handle any combination of characters A-Z, a-z, and 0-9.
Example in Python:
```
import sys
print "print('" + sys.argv[1] + "'... |
[Question]
[
## Challenge
Given two integers `A` and `B` as input, you must write a program which outputs if `A>B`, `A==B` or `A<B`.
The integers will be in any reasonable range supported by your language which includes at least 256 values.
Your program can be either a full program or a function, taking input via S... |
[Question]
[
*Inspired by [this comment...](https://codegolf.stackexchange.com/questions/61115/make-your-language-unusable#comment147104_61115)*
*Thanks to users [Step Hen](https://codegolf.stackexchange.com/users/65836/step-hen), [Wheat-Wizard](https://codegolf.stackexchange.com/users/56656/wheat-wizard), and [Den... |
[Question]
[
The [Fibonacci Sequence](https://en.wikipedia.org/wiki/Fibonacci_sequence) is a sequence of positive integers where the first two elements are 1 and the rest are the sum of the previous two. It begins \$1, 1, 2, 3, 5, 8, 13\$ and continues forever.
But what if you started with numbers other than \$1, 1... |
[Question]
[
The [Fibonacci sequence](https://en.wikipedia.org/wiki/Fibonacci_number) is a fairly well known thing around here. Heck, it even has its own tag. However, for all that, we sure like to stick to our roots of `1, 1, ...` (or is it `0, 1, ...`? We may never know...). In this challenge, the rules are the s... |
[Question]
[
Between the [kitten question](https://codegolf.stackexchange.com/questions/59029/the-kitten-command) and seeing [this question at U&L](https://unix.stackexchange.com/questions/233014/how-does-the-command-sed-1ghd-reverse-the-contents-of-a-file) about some `sed` magic, how about implementing [`tac`](htt... |
[Question]
[
A big part of radio communication is the [NATO Phonetic Alphabet](https://en.wikipedia.org/wiki/NATO_phonetic_alphabet), which encodes letters as words to make them easier to understand over comms. Your job, if you wish to accept it, is to print them one by one.
You must print this exact string to stdo... |
[Question]
[
# or: Build a vertical quine
Inspired by [Take a stand against long lines](https://codegolf.stackexchange.com/q/124259/9365).
Your task is to build a vertical quine with as short a line length as possible.
## Scoring
Shortest line length (excluding newlines) wins, with [code-golf](/questions/tagged/cod... |
[Question]
[
Given an integer N perform the following steps: (using 9 as an example).
1. Receive input N. (`9`)
2. Convert N from base10 to base2. (`1001`)
3. Increase every bit by 1. (`2112`)
4. Treat the result as base3 and convert it back to base10. (`68`)
5. Return/Output the result.
---
## Input
May be receive... |
[Question]
[
## Introduction
There are lots of utilities out there capable of creating a high CPU load to stress-test your processor(s). On Microsoft Windows, you can even use the on-board `calculator.exe`, enter a large number like `999999999`, and press `n!` several times to make your CPU(s) work overtime.
But wh... |
[Question]
[
Show the random result of a dice toss if done with a cube shaped die, in ASCII.
```
$ dice
```
should result in one of
```
-----
| |
| o |
| |
-----
-----
|o |
| |
| o|
-----
-----
|o |
| o |
| o|
-----
-----
|o o|
| |
|o o|
-----
-----
|o o|
| o |
|o o|
-----
-----
|o o|
|o o|
|o o|
-----... |
[Question]
[
Create a bot to choose the smallest unique number.
(Based on a psychology experiment I heard about many years ago but haven't been able to track down again.)
### Rules
* Each game will consist of 10 randomly selected bots playing 1000 rounds.
* Each round, all bots select an integer from 1 to 10 (inclu... |
[Question]
[
Pick a quote or phrase that is exactly 5 words long, such as `Programming puzzles and code golf!`.
Write a program that, when appended to itself *n* times, outputs the first *n + 1* words of your phrase in order.
For example, if your program code was `MYPROG` and your phrase was `Programming puzzles an... |
[Question]
[
Given a number `N`, output a NxN right angled triangle, where each row `i` is filled with numbers up to `i`.
**Example**
**n** = 0
(no output)
**n** = 4
```
1
1 2
1 2 3
1 2 3 4
```
**n** = 10
```
1
1 2
1 2 3
.
.
.
1 2 3 4 5 6 7 8 9 10
```
(no alignment needed)
**n** = N
```
1
1 2
1 2 3
.
.
.
1 2 3 4 ..... |
[Question]
[
Imagine the following 24-hour clock that can be controlled by arrow keys:
```
╔══╗ ┌──┐
║00║:│00│
╚══╝ └──┘
HH mm
```
Pressing the up arrow twice (`↑↑`) will increase the currently focused hour input:
```
╔══╗ ┌──┐
║02║:│00│
╚══╝ └──┘
HH mm
```
Pressing the right arrow (`→`) will focus the other ... |
[Question]
[
Your input will be an English sentence, phrase, or word. It will only contain `a-zA-Z' -,.!?`. Your task is to take the input, remove spaces, and then redistribute capitalization such that letters at indexes that were capitalized before (and only letters at indexes that were capitalized before) are cap... |
[Question]
[
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/12340/edit).
Closed 9 years ago.
[Improve this question](/posts/12340/edit)
... |
[Question]
[
**The Task**
This is quite a simple coding task, all your program has to do is place a point on a canvas (or your alternative in another coding language) and connect it to all the dots already placed. Your program must take in one input, the number of dots that should be placed, and output some sort of... |
[Question]
[
The challenge is to golf a program when given a string composed of any number of asterisks, then a comma, than any number of asterisks, say which side has more.
The asterisk-strings can be empty.
# Output
`0` for ties.
`1` for the left.
`2` for the right.
# Examples
Input: `***,****` Output: `2`
Input:... |
[Question]
[
# Background
A [super-prime](https://en.wikipedia.org/wiki/Super-prime) is a prime number whose index in the list of all primes is also prime. The sequence looks like this:
>
> 3, 5, 11, 17, 31, 41, 59, 67, 83, 109, 127, 157, 179, 191, ...
>
>
>
This is [sequence A006450 in the OEIS](https://oeis.o... |
[Question]
[
## Challenge :
\$\pi\$ is supposed to be infinite. That means every number is contained inside the decimal part of \$\pi\$.
Your task will be to take a positive integer on input and return the position of this number in \$\pi\$ digits on output.
For example, if the input is `59`, we'll return `4`
**Her... |
[Question]
[
**This competition is over.**
The winner is CJam with 22 characters, beating [TwiNight](https://codegolf.stackexchange.com/users/6972/twinight)'s answer by one character. Congratulations [Dennis](https://codegolf.stackexchange.com/users/12012/dennis)!
An honorable mention goes to [Falko](https://codego... |
[Question]
[
Consider a string of length N, such as `Peanut Butter` with N = 13. Notice that there are N-1 pairs of neighboring characters in the string. For `Peanut Butter`, the first of the 12 pairs is `Pe`, the second is `ea`, the last is `er`.
When the pairs are mostly different characters, the string has a chu... |
[Question]
[
With challenges like [Output with the same length as the code](https://codegolf.stackexchange.com/questions/121056/output-with-the-same-length-as-the-code) and [Create output twice the length of the code](https://codegolf.stackexchange.com/questions/59436/create-output-twice-the-length-of-the-code/), I... |
[Question]
[
This idea is loosely based upon @TùxCräftîñg's [chat message.](http://chat.stackexchange.com/transcript/message/32094684#32094684)
Take a look at the below example sequence:
`INVALID0`, `INVALID1`, `INVALID2` `INVALID3`, `INVALID4`... `INVALID9`
After `INVALID9`, it goes on like this:
`INVALI0`, `INVAL... |
[Question]
[
# Objective
Your goal is to make a program that converts an input to its acronym. Your input is guaranteed to have only letters and spaces. The input will have exactly one space between words. You must output the acronym of the input.
# Rules
* Your code cannot be case-sensitive(e.g. `foo` and `Foo` ar... |
[Question]
[
Inspired by this Stack Overflow question: [Sorting a list: numbers in ascending, letters in descending](https://stackoverflow.com/questions/45541119/sorting-a-list-numbers-in-ascending-letters-in-descending). Your task is to solve the following problem and, as this is [code-golf](/questions/tagged/code... |
[Question]
[
Given a list of strictly positive integers, go through each distinct number and replace all occurrences of it with successive indices (zero or one based) of a new series.
## Examples
`[]` → `[]`/`[]`
`[42]` → `[0]`/`[1]`
`[7,7,7]` → `[0,1,2]`/`[1,2,3]`
`[10,20,30]` → `[0,0,0]`/`[1,1,1]`
`[5,12,10,12,12... |
[Question]
[
We are all familiar with the [Fibonacci sequence](https://oeis.org/A000045):
```
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765
```
However, instead of, `f(n) = f(n-1) + f(n-2)` we'll be taking [digital sum](https://en.wikipedia.org/wiki/Digit_sum) of the previ... |
[Question]
[
Is [solving Sudoku](https://codegolf.stackexchange.com/questions/355/implement-a-non-guessing-sudoku-solver) too hard? Even the [brute force](https://codegolf.stackexchange.com/questions/378/implement-a-brute-force-sudoku-solver) version? Here's a coding exercise that's a little easier. I hope. :-P
Wri... |
[Question]
[
# Challenge
Write a program or function that converts a 32 bit binary number to its [quad-dotted decimal](https://en.wikipedia.org/wiki/Dot-decimal_notation) notation (often used for representing IPv4)
# Quad-dotted decimal
A quad-dotted decimal is formed like so:
1. Split the binary representation int... |
[Question]
[
## Challenge
Robin likes having his variables declaration in the shape of an arrow. Here's how he does it:
* Input any number of strings
* Order them by ascending length
* Output them ordered by the middle to roughly form a negative arrowhead, like this (whichever order golfs the best):
```
5 or 4
3 ... |
[Question]
[
Write two triangle (i.e. pyramid) shaped programs.
The first one should be an upwards pointing text triangle with a minimum base width of three characters. So it would have a structure like
```
X
XXX
```
or
```
X
XXX
XXXXX
```
or
```
X
XXX
XXXXX
XXXXXXX
```
or larger. Each of the `X`'s is to ... |
[Question]
[
**The unnecessary and convoluted story**
I am walking around [manhattan, block by block](http://en.wikipedia.org/wiki/Taxicab_geometry) and my feet have gotten tired and want to go back home.
The traffic is pretty bad, but fortunately I'm very rich and I have a helicopter on standby at the hotel. But I... |
[Question]
[
As some of you may know, to get a language onto Dennis's wonderful [Try It Online!](https://tio.run/#), a Hello, World! program is required. Recently, Dennis pushed up a way to load these programs from the website. Here is a JSON [pastebin](https://pastebin.com/jVifgcZ6) of the characters used in those... |
[Question]
[
Write a program or function that takes in a nonempty single-line string. The string will either be zero or more spaces followed by one period (a [particle](https://en.wikipedia.org/wiki/Wave)), such as `.` or `.`, ***or*** the string will be a sequence of one or more alternating forward and back slashe... |
[Question]
[
### Introduction
Let's take the number `180`. This is an interesting number because the sum of digits of this number is equal to:
```
1 + 8 + 0 = 9
```
And the squared version of this number, or:
```
180² = 32400 > 3 + 2 + 4 + 0 + 0 = 9
```
These are both **9**. The sum of digits of the original number... |
[Question]
[
Consider the sequence \$(a\_n)\$ defined in the following way.
* \$a\_0=0\$
* For all \$n=1, 2, 3, \dots\$, define \$a\_n\$ to be the smallest positive integer such that \$a\_n-a\_i\$ is not a square number, for any \$0\leq i<n\$
In other words, this is the lexicographically first sequence where no two... |
[Question]
[
This task is simple: Write a program or function that outputs the list of all musical notes (using English note names) from A♭ to G♯.
All notes without a name consisting of a single letter (i.e. black notes on a musical keyboard) should have their name printed twice, once as the sharp of a note, once a... |
[Question]
[
In base-10, all perfect squares end in \$0\$, \$1\$, \$4\$, \$5\$, \$6\$, or \$9\$.
In base-16, all perfect squares end in \$0\$, \$1\$, \$4\$, or \$9\$.
Nilknarf describes why this is and how to work this out very well in [this](https://math.stackexchange.com/a/2372342/467325) answer, but I'll also gi... |
[Question]
[
Make a fake loader just like this :

## Parameters :
* Display `loading` (space) one of these cyclically`-\|/` (space) (percentage counter from 0-100) then a `%`.
* The percentage counter is supposed to increment by 1 every time the display changes.
* The time... |
[Question]
[
Your goal is to create a program that prints itself indefinitely, with a new line after each one. Thus, if your program is a one-liner, it would be repeated on every line of the output.
### Example
Program:
```
A
```
Output:
```
A
A
A
...
```
### Rules
* It must be a complete program, not a snippet o... |
[Question]
[
Consider the [Atbash transformation](https://en.wikipedia.org/wiki/Atbash):
```
A|B|C|D|E|F|G|H|I|J|K|L|M
Z|Y|X|W|V|U|T|S|R|Q|P|O|N
```
Where A ⇔ Z and L ⇔ O, e.g. There is an interesting property that some words share. When some strings are translated to their atbash-equivalent, said translation is th... |
[Question]
[
Well, Brexit [happened](http://www.bbc.co.uk/news/uk-politics-39431428). And Sky News, being the geniuses they are, have decided to create a countdown on the side of a bus.
[](https://i.stack.imgur.com/MCAE7.png)
Your job is to do some... |
[Question]
[
Good Evening Golf Agents,
Your mission is on behalf of notorious entertainment giant Eviltronic Arts. As part of their nefarious plan for world enslavement and entertainment, they must sell as many copies of SimStation V as possible. This means that the software must mysteriously stop working, after s... |
[Question]
[
A Cullen Number is any number that is contained in the sequence generated using the formula:
C(n) = (n\*2^n)+1.
## Your Task:
Write a program or function that receives an input and outputs a truthy/falsy value based on whether the input is a Cullen Number.
## Input:
A non-negative integer between 0 a... |
[Question]
[
### Background
The Sidi polynomial of degree \$n\$ – or the \$(n + 1)\$th Sidi polynomial – is defined as follows.
$$S\_n(x) = \sum^n\_{k=0}s\_{n;k}x^n \text{ where } s\_{n;k} = (-1)^k\binom n k (k+1)^n$$
The Sidi polynomials have several interesting properties, but so do their coefficients. The latter... |
[Question]
[
Your challenge is to write **N** snippets of code such that, when you concatenate the first **K** ≥ 1 together, they produce the number **K**. The higher **N**, the better. Here's the catch: you may not use any character more than once across your snippets.
## Rules
* You may use the same character mul... |
[Question]
[
You are given two strings, each consisting of the English word for a number between **1** and **13**:
```
one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirteen
```
Your program or function must find out whether it's possible to spell at least one other word from the same l... |
[Question]
[
Your job is to create the slowest growing function you can in no more than 100 bytes.
Your program will take as input a nonnegative integer, and output a nonnegative integer. Let's call your program P.
It must meet the these two criterion:
* Its source code must be less than or equal to 100 bytes.
* Fo... |
Subsets and Splits
Python Q&A Count
Counts the number of questions and answers related to Python in the dataset, providing insight into the prevalence of Python content.