text stringlengths 180 608k |
|---|
[Question]
[
Your task, if you wish to accept it, is to write a program that outputs a non-zero number(can be integer or float). The tricky part is that if I reverse your source code, the output must be the original integer negated.
# Rules
* You must build a **full program**. That is, your output has to be printed... |
[Question]
[
## About the Series
This is a guest entry for the Random Golf of the Day series.
First off, you may treat this like any other code golf challenge, and answer it without worrying about the series at all. However, there is a leaderboard across all challenges. You can find the leaderboard along with some ... |
[Question]
[
What general tips do you have for golfing in Perl? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Perl (e.g. "remove comments" is not an answer). Please post one tip per answer.
[Answer]
## TMTOWTDI
That's the most important Perl g... |
[Question]
[
I would like to generate (as a return result of a function, or simply as the output of a program) the [ordinal](http://en.wikipedia.org/wiki/Ordinal_number_%28linguistics%29) suffix of a positive integer concatenated to the number.
Samples:
```
1st
2nd
3rd
4th
...
11th
12th
13th
...
2... |
[Question]
[
**Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers.
---
Questions without an **objective primary winning criterion** are off-topic, as they make it impossible to indisputably decide which entry should win.
Closed 7 years ago.
[Improve this quest... |
[Question]
[
The input is a word of lowercase letters not separated by whitespace. A newline at the end is optional.
The same word must be output in a modified version: For each character, double it the second time it appears in the original word, triple it the third time etc.
Example input:
```
bonobo
```
Example ... |
[Question]
[
Write a program or function that outputs this exact text, case-insensitive:
```
A, B, C, D, E, F, G,
H, I, J, K, L, M, N, O, P,
Q, R, S,
T, U, V,
W, X, Y, Z.
```
(Based on the [alphabet song](https://en.wikipedia.org/wiki/Alphabet_song#The_A.B.C._.28Verse_1.29) that many American kids learn to help mem... |
[Question]
[
Based on the [Duct tape can fix anything](https://codegolf.stackexchange.com/questions/26778/duct-tape-can-fix-anything) question, that was too broad, with very similar rules. Only this time the objective is very specific:
# The challenge
Your mission is to make a program that displays `hello mom` -- w... |
[Question]
[
# 4-Man Standoff
## Description
You've somehow found yourself into a four-way standoff. A loaded gun rests in your hands, and some grenades are hooked on your belt.
The objective is to have the most health at the end of a standoff. A standoff is over when at most one person has a positive amount of he... |
[Question]
[
The Illuminati commands you (with their mind control) to output the following string:
```
^
/_\
/_|_\
/_|_|_\
/_|/o\|_\
/_|_\_/_|_\
/_|_|_|_|_|_\
/_|_|_|_|_|_|_\
/_|_|_|_|_|_|_|_\
/_|_|_|_|_|_|_|_|_\
```
# Rules:
* Trailing spaces are allowed for each line.
... |
[Question]
[
Given two strings, output a third string that is not equal to either of the two inputs, but has the same length (in characters) as either of the inputs. There is guaranteed to be at least one valid output.
# Test Cases
Test cases are quoted to show they are strings. Outputs are one of many possible.
``... |
[Question]
[
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 to actually be *truthy* or *falsy*. For an answer to be valid it must meet four additional criteria
... |
[Question]
[
This is a follow up to [How slow is Python really? (Or how fast is your language?)](https://codegolf.stackexchange.com/questions/26323/how-slow-is-python-really-or-how-fast-is-your-language).
It turns out it was a bit too easy to get a x100 speedup for my last question. For those who have enjoyed the c... |
[Question]
[
Given an unsigned 16-bit integer ***N***, your task is to determine whether its binary representation mapped inside a 4x4 matrix is matching a [tetromino shape](https://en.wikipedia.org/wiki/Tetromino), and if so, which shape it is.
## Matrix
Each bit of ***N*** is mapped inside a 4x4 matrix, from left... |
[Question]
[
Let's make an ASCII art clock and calendar that tells us the current month, day of the month, day of the week, hour, minute, and whether it's night or day (but not the year or second).
At any particular time the calendar will look something like this: (it looks better with less line spacing)
```
_____... |
[Question]
[
This is not a challenge but a question, I figured it was on topic because of
>
> Non-challenge questions that are related to solving programming puzzles or a particular type of challenge are also on topic.
>
>
>
Now on to the question:
Is it possible to write any JavaScript code with only 5 letters... |
[Question]
[
In the game of Freecell, you are tasked with building four foundation piles in suit from ace to king, on a layout where you build downward in alternating colours. However, you can only build one card at a time, so you are given four "free cells" each of which can contain one card to help you move entir... |
[Question]
[
Write a program that creates a two-state [checkbox](https://en.wikipedia.org/wiki/Checkbox) that people can interact with using a mouse.
Specifically, your program should achieve all of the following:
1. Have a 8×8 pixel (or larger if desired) region of the screen that is the clickable area of the chec... |
[Question]
[
Make a program that takes the word you input, and adds that word to the back of itself minus its first letter, then repeats until all letters are gone. For example, `cat` would become `catatt`, and `hello` would become `helloellolloloo`.
**Input**
Any of the 26 letters of the English alphabet. There ... |
[Question]
[
Write a function or program that takes as its input a string and prints a truthy value if the string is a [pangram](https://en.wikipedia.org/wiki/Pangram) (a sequence of letters containing at least one of each letter in the English alphabet) and a falsey value otherwise.
Case of letters should be ignor... |
[Question]
[
## Definitions
* An algebraic number is a number that is a zero of a non-zero polynomial with integer coefficients. For example, the square root of `2` is algebraic, because it is a zero of `x^2 - 2`.
* A transcendental number is a real number which is not algebraic.
## Task
You are to choose a transce... |
[Question]
[
## Multiplicative Persistence
1. Multiply all the digits in a number
2. Repeat until you have a single digit left
As explained by *Numberphile*:
* [*Numberphile* "What's special about 277777788888899?"](https://www.youtube.com/watch?v=Wim9WJeDTHQ)
* [*Numberphile* "Multiplicative Persistence (extra foo... |
[Question]
[
The challenge is simple:
Write a function or program that takes an input `x`, and outputs the lower case alphabet if `x` is part of the lower case alphabet, outputs the upper case alphabet if `x` is part of the upper case alphabet and outputs just `x` if it's not part of either.
Rules:
* The input can ... |
[Question]
[
This is my first golf contest.
**What you need to do**
Build me, in the shortest amount of bytes possible, my AC remote control system. My room is too cold right now, and I'm missing my remote.
Now, I don't want you literally building it or anything, just golf this:
A slow increment of temperature, sta... |
[Question]
[
Given an input string S, return `truthy` if all the letters in S are Lexically Ordered: their ASCII values need to be in either ascending or descending order. Return `falsy` in other cases.
## Input
* Input will be in the same case (all upper- or all lowercase). Your submission should be able to handle... |
[Question]
[
**Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers.
---
Questions without an **objective primary winning criterion** are off-topic, as they make it impossible to indisputably decide which entry should win.
Closed 7 years ago.
[Improve this quest... |
[Question]
[
### Introduction
If you're not familiar with [Hexagony](https://github.com/mbuettner/hexagony), it's an esoteric language created by Martin Büttner. The thing is that this language accepts multiple forms for the program. The following programs are all equivalent:
```
abcdefg
```
and
```
a b
c d e
f g... |
[Question]
[
[Portable Spec](https://gist.github.com/Maltysen/70f56bdbaa82f308cb03).
*Iɴꜱᴘɪʀᴇᴅ ʙʏ @ConorO'Brien's ᴜꜱᴇʀɴᴀᴍᴇ.*
*Aʟꜱᴏ ᴛʜᴀɴᴋꜱ ᴛᴏ @Dᴏᴏʀᴋɴᴏʙ ꜰᴏʀ ꜱʜᴏᴡɪɴɢ ᴍᴇ ᴛʜᴇ ᴇxɪꜱᴛᴇɴᴄᴇ ᴏꜰ `ǫ` ᴀɴᴅ `x`.*
Sᴍᴀʟʟ Cᴀᴘꜱ ᴀʀᴇ ᴘʀᴇᴛᴛʏ ᴄᴏᴏʟ. Tʜᴇʏ ᴀʀᴇ ᴜɴɪᴄᴏᴅᴇ ᴄʜᴀʀᴀᴄᴛᴇʀꜱ ᴛʜᴀᴛ ʀᴇᴘʟᴀᴄᴇ ꜱᴍᴀʟʟ ʟᴇᴛᴛᴇʀꜱ. Tʜᴇʏ ʟᴏᴏᴋ ᴊᴜꜱᴛ ʟɪᴋᴇ ᴛʜᴇ ᴄᴀᴘɪᴛᴀʟ ᴏɴᴇ... |
[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/3105/edit).
Closed 6 years ago.
[Improve this question](/posts/3105/edit)
Yo... |
[Question]
[
Based on [Practical Golf - US States](https://codegolf.stackexchange.com/questions/38499/practical-golf-us-states)
Your task is to find the abbreviation (symbol) of an element given the element name, up to and including ununoctium (118). Use the periodic table on [Wikipedia](https://en.wikipedia.org/w/... |
[Question]
[
**Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers.
---
This question does not appear to be about code golf or coding challenges within the scope defined in the [help center](https://codegolf.stackexchange.com/help/on-topic).
Closed 7 years ago.... |
[Question]
[
[Identicons](https://en.wikipedia.org/wiki/Identicon) are visual depictions of hash values, often made from symmetrical arrangements of geometric shapes. [Your default Stack Exchange avatar is an identicon.](https://meta.stackexchange.com/q/17443/266052) This challenge is about creating **"wordenticons... |
[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/5933/edit).
Closed 3 years ago.
[Improve this question](/po... |
[Question]
[
I promise, this will be my last challenge about diamong tilings (for a while, anyway). On the bright side, this challenge doesn't have anything to do with ASCII art, and is not a code golf either, so this is actually completely different.
So just as a reminder, every hexagon can be titled with three di... |
[Question]
[
Given two positive integers, \$A\$ and \$B\$, illustrate their [least common multiple](https://en.wikipedia.org/wiki/Least_common_multiple) by outputting two lines of dashes (`-`) with length [\$\text{lcm}\$](https://en.wikipedia.org/wiki/Least_common_multiple)\$(A, B)\$ after replacing every \$A\$th d... |
[Question]
[
*This task is part of the [First Periodic Premier Programming Puzzle Push](http://meta.codegolf.stackexchange.com/q/298/15).*
You get a hierarchy of items in the following format:
```
2
Hat
1
Gloves
```
which need to be put in boxes, like so:
```
.------------.
| Hat |
| .--------. |
| | Gloves ... |
[Question]
[
## Background
Variable declaration statement in C consists of three parts: the *name* of the variable, its *base type*, and the *type modifier(s)*.
There are three kinds of type modifiers:
* Pointer `*` (prefix)
* Array `[N]` (postfix)
* Function `()` (postfix)
+ You can specify a list of function arg... |
[Question]
[
Countries own a series of territories on a 1D world. Each country is uniquely identified by a number. Ownership of the territories can be represented by a list as follows:
```
1 1 2 2 1 3 3 2 4
```
We define a country's edgemost territories as the two territories closest to either edge. If the above li... |
[Question]
[
You may or may not remember Xeyes, a demo program that came with (and, as far as I know, still comes with) the X window system. Its purpose was to draw a pair of eyes that followed your mouse cursor:
[](https://i.stack.imgur.com/bmanm.png)
Your challenge is ... |
[Question]
[
Some versions of the standard Android calculator app allow you to press a key, like 'sin' and then the 'del' key to make it 'si'. Probably just a bug which they can't be bothered with removing.
[](https://i.stack.imgur.com/EyDGLl.... |
[Question]
[
## Introductions
A 2×n Boolean matrix can be represented as a string of the four characters `. ':`.
The string has an "upper row" and a "lower row", with dots representing 1s and empty spaces representing 0s.
For example, the 2×6 matrix
```
1 0 1 0 0 1
0 0 0 1 0 1
```
can be represented as `' '. :`.
Yo... |
[Question]
[
The gravitational force is a force that attracts any two objects with mass. In this challenge our objects will be Numbers and their mass will be their value. To do so, we don't care about the strength of the force but the direction of it.
Imagine this set of numbers
```
[1 6 9 4 6 9 7 6 4 4 9 8 7]
```... |
[Question]
[
I love programming and know every language, but I suck at math. Unfortunately, my school requires that computers students must take a year of calculus. There's a test next week, and I don't know any of the formulas for derivatives!
Please help me find the formulas. I need a cheat sheet - a program (as ... |
[Question]
[
You're given the map of a cinema theatre as a boolean matrix: 0 represents a free seat, 1 - occupied. Each [Finn](https://finnishnightmares.blogspot.fi/) who walks in chooses the seat farthest away ([Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance)) from the nearest occupied one, o... |
[Question]
[
What general tips do you have for golfing in Windows PowerShell? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to PowerShell (e.g. "remove comments" is not an answer). Please post one tip per answer.
—taken nearly verbatim from [marcog's ... |
[Question]
[
What general tips do you have for golfing in Mathematica? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Mathematica (e.g. "remove comments" is not an answer).
[Answer]
Some built-in functions with long names can be replaced with ... |
[Question]
[
You are to print this exact text:
```
A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
ABCDEFEDCBA
ABCDEFGFEDCBA
ABCDEFGHGFEDCBA
ABCDEFGHIHGFEDCBA
ABCDEFGHIJIHGFEDCBA
ABCDEFGHIJKJIHGFEDCBA
ABCDEFGHIJKLKJIHGFEDCBA
ABCDEFGHIJKLMLKJIHGFEDCBA
ABCDEFGHIJKLMNMLKJIHGFEDCBA
ABCDEFGHIJKLMNONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPONMLKJIHG... |
[Question]
[
# Definition
A dollar word is a word where when each of its letters is given a cent value, from a = 1 to z = 26, and the letters are summed, the result is 100. [Here](https://codereview.stackexchange.com/questions/58446/program-to-find-dollar-words) is an example on CodeReview, and [here](http://mathla... |
[Question]
[
# Challenge
So, um, it seems that, while we have plenty of challenges that work with square numbers or numbers of other shapes, we don't have one that simply asks:
Given an integer `n` (where `n>=0`) as input return a truthy value if `n` is a perfect square or a falsey value if not.
---
## Rules
* You ... |
[Question]
[
I think we've all done this as a kid: some websites require a minimum age of 18, so we just subtract a few years from the year of birth and voilà, we 'are' 18+.
In addition, for most rides at amusement parks the minimum height to enter is 1.40 meters (here in The Netherlands it as at least). Of cours... |
[Question]
[
My friend and I were working on a lab in our AP Computer Science class and decided to code golf one one the problems since we still had half the class free after we finished. Here is the question:
>
> Given a number n, is n divisible by each of its digits?
>
>
>
For example, 128 will pass this test... |
[Question]
[
Steve Ballmer is the ex-CEO of Microsoft, and in a [recent article](https://mspoweruser.com/steve-ballmer-still-not-know-wrong-mobile/), claimed that he "still does not know what he did wrong with mobile".
As [CodeProject](https://www.codeproject.com/)'s newsletter pointed out, "That article's title co... |
[Question]
[
# Background
The Royal Netherlands Meteorological Institute [defines a heat wave](https://www.knmi.nl/kennis-en-datacentrum/uitleg/hittegolf)\* as a series of **at least** 5 **consecutive** days of ≥25°C weather (“summery weather”), such that **at least** 3 of those days are ≥30°C (“tropica... |
[Question]
[
# 99 bugs in the code
The adaption of "99 bottles of beer on the wall" for computer science where the bugs increase instead of the bottles decreasing is often re-posted around the internet. [Example T-Shirt Here](https://www.reddit.com/r/ProgrammerHumor/comments/8l68th/this_really_how_it_be_tho/?ref=sh... |
[Question]
[
Similar to our threads for language-specific golfing tips: what are general tricks to shorten regular expressions?
I can see three uses of regex when it comes to golfing: classic regex golf ("here is a list that should match, and here is a list that should fail"), using regex to solve [computational p... |
[Question]
[
# Background
There's a common riddle that goes something like this:
>
> A snail is at the bottom of a 30 foot well. Every day the snail is able to climb up 3 feet. At night when they sleep, they slide back down 2 feet. How many days does it take for the snail to get out of the well?
>
>
>
The intui... |
[Question]
[
**Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers.
---
This question does not appear to be about code golf or coding challenges within the scope defined in the [help center](https://codegolf.stackexchange.com/help/on-topic).
Closed 7 years ago.... |
[Question]
[
While I was traveling in the future, I noticed a funny game among kids circa 2275. When they don't want their great-great-great-great-grand parents to understand what they're saying, they use the ***BIBABOBU speak***. Obviously, I couldn't understand anything either with my pre-cyborg era brain and I f... |
[Question]
[
This is [**Fortnightly Challenge #6**](http://meta.codegolf.stackexchange.com/questions/3578/fortnightly-challenge-ideas). Theme: **Language Design**
>
> There's [a chatroom](http://chat.stackexchange.com/rooms/21289/fortnightly-challenge-of-2015-02-20-language-design) for this challenge. Come and joi... |
[Question]
[
## Goal
This is a simple challenge. Your goal is to unscramble a string by swapping each letter with the next letter of the same case, while leaving non-letter characters unchanged.
[](https://i.stack.imgur.com/ubgD2.png)
## Step by step explanation
1. The... |
[Question]
[
Given a side-view of a mini-golf course and the power of the swing, determine if the ball will make it into the hole.
---
A course will be in this format:
```
____ ____ _
__/ \ / U \
__/ \ / \_
\_/
```
The ball starts directly **befor... |
[Question]
[
Computers are everywhere nowadays - in cars, trains, skateboards, even nuclear reactors. The possibility that your software will run in a time travelling device is just a matter of time. Can you deal with it? Can you at least detect it?
Your task:
1. Write a program that loops and keeps querying the sy... |
[Question]
[
Create a program which prints the amount of characters its source has in English words.
If your program is nine letters long it should print "nine".
Capitalization is ignored: in case you're printing "one" (somehow) you can print "one", "oNe", "ONE" or anything else.
Base ten is required.
Proper spacin... |
[Question]
[
**Locked**. This question and its answers are [locked](/help/locked-posts) because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
Given an integer array, write a program that determines if it is sorted in ascending order.
Rememb... |
[Question]
[
Your task is simple: given two integers \$a\$ and \$b\$, output \$\Pi[a,b]\$; that is, the product of the range between \$a\$ and \$b\$. You may take \$a\$ and \$b\$ in any reasonable format, whether that be arguments to a function, a list input, STDIN, et cetera. You may output in any reasonable forma... |
[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/19801/edit).
Closed 7 years ago.
[Improve this question](/p... |
[Question]
[
Write a program which runs forever and allocates more and more memory on the heap the longer it runs, at least until you reach the limit of the operating system on the amount of memory that can be allocated.
Many kernels won't actually reserve memory you allocate until you use it for something, so if y... |
[Question]
[
# Winner: [professorfish's bash answer](https://codegolf.stackexchange.com/questions/32151/convert-1-2-3-4-5-6-7-8-and-9-to-one-two-three-etc/32232#32232)! An entire 9 bytes! Wow!
You may continue to submit your answer, however you can no longer win. Original post kept for posterity:
---
Your goal is t... |
[Question]
[
On some terminals, pressing backspace generates the control code `^H` to delete the previous character. This gave rise to a snarky idiom where [edits are feigned for comedic effect](http://www.catb.org/~esr/jargon/html/writing-style.html):
>
> Be nice to this fool^H^H^H^Hgentleman, he's visiting from ... |
[Question]
[
So, last week I posted a challenge to play [Duck, Duck, Goose](https://codegolf.stackexchange.com/questions/157897/duck-duck-goose). This lead to a number of Minnesotans commenting about their regional ['Gray duck' variation](https://en.wikipedia.org/wiki/Duck,_duck,_goose#Duck,_Duck,_Gray_Duck).
So he... |
[Question]
[
Given a number *n* (0 <= *n* <= 2642245), check if *n* and *n*3 have the same set of digits, and output a truthy or falsey value accordingly.
For example, let's check the number 100.
1003 is 1000000.
The set of digits in 100 is {0, 1}.
The set of digits in 1000000 is {0, 1}.
Therefore, 100 should give ... |
[Question]
[
# Introduction
One day, you were showing your kid how to draw on a computer. You type `mspaint.exe` in the run bar. To your horror, it says "No items match your search". You must create a simple version of paint so your kid can draw!
# Challenge
You must create a simple drawing program. To do this, ope... |
[Question]
[
*Inspired by [a question](https://stackoverflow.com/q/43640022/2586922) over at Stack Overflow. The title here is entirely my fault.*
---
## The challenge
Given a list of positive integers containing at least two entries, replace each number by the minimum of all entries excluding itself.
## Test cases... |
[Question]
[
A [polyglot](/questions/tagged/polyglot "show questions tagged 'polyglot'") is a program that can be run in 2 or more different programming languages.
What general tips do you have for making polyglots, or choosing languages that are easy to write polyglots for a specific task?
Please post the tips tha... |
[Question]
[
>
> **Note: The survey for community favorite will be released soon**
>
>
>
In this KoTH, the aim is to be the last bot alive. Coins will be placed in random areas, and your bot must get the coins first. If a bot runs into another bot, the bot with more coins wins, and the other bot dies. More deta... |
[Question]
[
Your task is to improvise a hardware random-number generator with whatever hardware you have lieing around.
## Challenge
Write a program with the following properties:
1. It prints either `0` or `1` (and nothing else).
2. The output depends on a physical process and not just the internal state of the c... |
[Question]
[
Given a non-negative number `n`, output the number of ways to express `n` as the sum of two squares of integers `n == a^2 + b^2` ([OEIS A004018](https://oeis.org/A004018)). Note that `a` and `b` can be positive, negative, or zero, and their order matters. Fewest bytes wins.
For example, `n=25` gives `1... |
[Question]
[
>
> The contest is now over. [Coward](https://codegolf.stackexchange.com/questions/34833/save-the-last-bullet-for-yourself#35021) is the winner.
> You can watch the last match [here](http://s3.amazonaws.com/codegolf_zombies/0.html).
>
>
>
Suddenly zombies appear! OH NOES!
In this king-of-the-hill ... |
[Question]
[
It seems that simple changes to a C++ file, especially with templates, can generate pages of errors. This contest is to see what the largest "bang of the buck" is, that is the more verbose error output with the smallest change to the source code (1 character addition).
Because other languages are more ... |
[Question]
[
Given a non-negative integer skyline height list, answer how many uninterrupted 1-unit-high horizontal brush strokes are needed to cover it.
`[1,3,2,1,2,1,5,3,3,4,2]`, visualised as:
```
5
5 4
3 5334
32 2 53342
13212153342
```
needs nine brush strokes:
```
1
2 3... |
[Question]
[
## Input
A non-empty encoded string consisting of printable ASCII characters (in the range 32-126), where some missing letters have been replaced with `_`.
## Output
A decoded string of the same length with all letters in lowercase, including the missing ones.
## How?
*Edit: As mentioned by @Deusovi in... |
[Question]
[
Stack Exchange automagically [detects serial
voting](https://meta.stackexchange.com/q/126829/180276) (when one user either
upvotes or downvotes many of another user's posts) and reverses it. In this
challenge, you will implement a very, very simple "serial vote" detector.
## Input
The input is a string... |
[Question]
[
One of my favorite memes is the [bouncing DVD logo](https://knowyourmeme.com/memes/bouncing-dvd-logo). Yet silly but extremely satisfying, a DVD logo keeps bouncing on a screen and if you ever happened to watch this screensaver, you were most likely anxiously waiting for the logo to exactly hit the cor... |
[Question]
[
Your task here will be to implement a function1 that forms a permutation on the positive integers (A bijection from the positive integers onto themselves). This means that each positive integer should appear exactly once in the permutation. The catch is your function should have a larger probability of... |
[Question]
[
It is common to need to make a page selection interface. It typically looks like this:
```
prev 1 ... 3 4 [5] 6 7 ... 173 next
```
Which means there are totally 173 pages, and you are on the 5th page currently.
This challenge requires you take the total number of pages and the current page number as in... |
[Question]
[

[Mr. Mackey](https://en.wikipedia.org/wiki/List_of_South_Park_Elementary_staff#Mr._Mackey) is a [South Park](https://en.wikipedia.org/wiki/South_Park) character well-known for adding "m'kay" in everything he says.
Write a program or function that transforms a st... |
[Question]
[
If you have ever looked at an objdump of a C++ program, you have likely seen something like this:
```
_ZN3foo3bar3bazI6sampleEE3quxvi3foo
```
This is a C++ mangled symbol, which encodes the namespaces, classes, and function/template arguments, using the [Itanium ABI](https://itanium-cxx-abi.github.io/c... |
[Question]
[
### Introduction
"Yarr!! We had a laddie who called himself a "programmer" make a map t' our hidden treasure! But 'tis written wit' weird numbers 'n letters! "E5, N2, E3"... what does it even mean? Madness! Can't even scribe a proper treasure map, t' useless cretin. Fix it fer us! We'll gift ye a share... |
[Question]
[
I have a crank-operated music box that can play a series of four notes. When I turn the crank, it plucks one of four strings, depending on the position of the crank and the direction of the turn. When the crank is turned due north, the box (with its strings numbered 1 through 4) looks like this:
```
1 ... |
[Question]
[
The "prime ant" is an obstinate animal that navigates the integers and divides them until there are only primes left!
---
Initially, we have an infinite array A containing all the integers >= 2 : `[2,3,4,5,6,.. ]`
Let `p` be the position of the ant on the array. Initially, `p = 0` (array is 0-indexed)
... |
[Question]
[
The world is full of [Turing-complete](https://en.wikipedia.org/wiki/Turing_completeness) programming languages. Just about every useful language (and most useless ones) are Turing-complete. Some even became Turing-complete [by accident](http://beza1e1.tuxen.de/articles/accidentally_turing_complete.htm... |
[Question]
[
While there are many code golf questions on here involving randomness, I haven't seen one yet that actually asks for building an algorithmic pseudorandom number generator. There's [this one](https://codegolf.stackexchange.com/questions/6868/generate-a-completely-deterministic-pseudorandom-bit-stream) t... |
[Question]
[
This was inspired by a math problem I saw somewhere on the internet but do not remember where (UPDATE: The original problem was found on [the math riddles subreddit](https://www.reddit.com/r/mathriddles/comments/2v6eaj/doubling_and_adding_1/) with a proof provided that it is possible, also see [this Ma... |
[Question]
[
You may have seen something called a "perpetual dice calendar":
[](https://i.stack.imgur.com/7O4xb.jpg)
Two 6-sided dice can be rearranged and rotated. One die has the numbers 0, 1, 2, 3, 4, and 5. The second die has the numbers 0, 1, 2, ... |
[Question]
[
>
> In public-key cryptography, a public key fingerprint is a short sequence of bytes used to identify a longer public key.
>
>
>
In SSH in particular they can be used to verify that a server is in fact the server I'm expecting to communicate with and I'm not targeted by a man-in-the-middle attack.... |
[Question]
[
# Tupper's Self-Referential Formula (copied from Wikipedia)
Tupper's self-referential formula is a formula defined by Jeff Tupper that, when graphed in two dimensions at a very specific location in the plane, can be "programmed" to visually reproduce the formula itself. It is used in various math and c... |
[Question]
[
### The challenge
The shortest code by character count to help Robot find kitten in the fewest steps possible.
Golfers, this is a time of crisis - Kitten gone missing and it's Robot's job to find it! Robot needs to reach Kitten in the shortest path possible. However, there are a lot of obstacles in Rob... |
[Question]
[
This! is an RGB colour grid...
[](https://i.stack.imgur.com/ED5wv.png)
Basically it's a 2-dimensional matrix in which:
* The first row, and the first column, are red.
* The second row, and the second column, are green.
* The third row, and the third... |
[Question]
[
# The Task
Given a natural number as input, your task is to output a truthy or falsey value based on whether the input is a factorial of any natural number. You can assume that the input number will always be in the range of numbers supported by your language, but you must not [abuse native number type... |
[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/6836/edit).
Closed 3 years ago.
[Improve this question](/posts/6836/edit)
Qu... |
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.