text stringlengths 180 608k |
|---|
[Question]
[
Write two programs such that when the bytes of their source code are XOR-d together it produces a third, valid program, all in the same language. The length of each of the three programs in bytes must be identical.
The first program should output `A`. The second program should output `B`. The third pro... |
[Question]
[
[JSFuck](http://www.jsfuck.com/) is an esoteric language in which any Javascript statement can be accurately reproduced into another valid Javascript program that uses only the 6 characters `[]()!+`.
The JSFuck converter, when given an input of `alert("Hello World!")`, produces a block of code that is ... |
[Question]
[
**Write the shortest program that generates guitar tabs for the chords given as input.**
So that the guitarists among you don't have an advantage, and to make it deterministic (and probably easier to code), here are the **only** forms of the chords authorized:
```
Major chords:
E F F# G G# A ... |
[Question]
[
*(Randomly inspired by <https://mathoverflow.net/q/339890>)*
*(Related: [1](https://codegolf.stackexchange.com/q/12879/42963), [2](https://codegolf.stackexchange.com/q/89852/42963))*
Given an input list of distinct prime numbers (e.g., `[2, 5, 7]`), and a integer `n`, output all positive integers str... |
[Question]
[
**This question already has answers here**:
["Hello, World!"](/questions/55422/hello-world)
(974 answers)
Closed 7 years ago.
Is it possible to write (pack) a shorter than 145 bytes version of a program with "Hello world" (plus new line) output if the length of the program is measured as a numbe... |
[Question]
[
Given two nonempty arrays of natural numbers \$a\$ and \$b\$, return the shortest nonempty array of pairs of natural numbers \$q\$ such that the sequence of first elements of \$q\$ consists of a whole number of repeated copies of \$a\$, and the sequence of second elements of \$q\$ consists of a whole n... |
[Question]
[
## The Idea
We've done matrix spirals before, and full rotations, and even [diagonal
rotations](https://codegolf.stackexchange.com/questions/63755/rotate-the-anti-diagonals),
but not, as far as I can find, *snake rotations*!
What is a snake rotation?
Imagine the rows of a matrix snaking back and forth,... |
[Question]
[
Some of your employees have broken capslock keys and you're too cheap to replace them. Help them out by creating the shortest program possible to correct their work! Simply convert each character in a given string from uppercase to lowercase and vice-versa... but there's a twist!
You're also very excit... |
[Question]
[
It has been proven that the following 13 square [Wang tiles](http://en.wikipedia.org/wiki/Wang_tile) always tile the plane [aperiodically](http://en.wikipedia.org/wiki/Aperiodic_tiling). This means that when the squares are arranged in a grid with all neighboring sides the same color, a translation of ... |
[Question]
[
**This question already has answers here**:
[Compute the Kolakoski sequence](/questions/157403/compute-the-kolakoski-sequence)
(47 answers)
Closed 5 years ago.
## Definition1
>
> A Kolakoski sequence is a *self-describing* infinite sequence {kn} of alternating blocks of 1's and 2's, given by th... |
[Question]
[
[Hamming numbers](http://en.wikipedia.org/wiki/Hamming_numbers) are numbers which evenly divide a power of 60. Equivalently, their prime factors are all \$ \le 5 \$.
Given a positive integer, print that many Hamming numbers, in order.
Rules:
* Input will be a positive integer \$n \le 1,000,000 \$
* Out... |
[Question]
[
*The goal of this challenge is to fill a niche that is mostly lacking on this site. In my observations there most parsing verification challenges fall into two categories:*
1. Super easy parsing. This parsing can usually be done with a regex, and regex based answers usually do well.
2. Super complex pa... |
[Question]
[
Given a number from 1 to 24, output the kissing number to the best of current knowledge (some numbers will have more than one acceptable output). Knowledge of geometry is not essential as the outputs are all listed below.
From the [Wikipedia page on the Kissing Number Problem](https://en.wikipedia.org/... |
[Question]
[
As a kid, I used to play the card game *"[golf](https://en.wikipedia.org/wiki/Golf_(card_game))"* a lot. Your challenge, should you choose to accept it, is to calculate the score of a golf hand. Since there are over 9000 variations on this card game1, we will go with the rules I remember playing.
# Rul... |
[Question]
[
I like the concept of [0815](http://esolangs.org/wiki/0815), except the interpreter on the [creator's website](http://paulo-jorente.de/poncho/esolang/0815/) returns an Error 404. So I decided to ask you all to help!
# The Basics
0815 is based around three (3) registers and a queue. The registers are na... |
[Question]
[
## Background
Two numbers, \$a\$ and \$b\$, are said to be connected by a Brussels choice operation\* if \$b\$ can be reached from \$a\$ by doubling or halving (if even) a substring (the substring must not be empty and may not contain any leading 0s but it can be 0) in the base-10 representation of \$a... |
[Question]
[
Related: [Tell me how many math problems I have to do!](https://codegolf.stackexchange.com/questions/51189/tell-me-how-many-math-problems-i-have-to-do)
### Challenge
Given a strictly positive strictly ascending integer list L and an integer 3 ≤ N ≤ length of L, replace the middle integers of L's consec... |
[Question]
[
Your challenge is to **write a program to translate (English) leetspeak/lolspeak/txtspk into normal English.** Your program should read from standard input and output to standard output, unless your language does not support these.
You may use a file containing a list of words in the English language, ... |
[Question]
[
## Challenge
Given two binary vectors (containing two consistent values of your choice) of length \$n\$ and \$m\$, output a corresponding [ascii-art](/questions/tagged/ascii-art "show questions tagged 'ascii-art'") hitomezashi stitching pattern.
You are to fill the following pattern, where \$n\$ is the... |
[Question]
[
# Bowling
Bowling is a game where, essentially, each player gets 10 turns to:
Take 2 attempts at knocking down 10 pins arranged in a triangle.
* between turns the pins are reset
* from the 1st to the 2nd attempt the pins are left as-is
The arrangement of the pins resembles the following scheme, with th... |
[Question]
[
*As a celebration of [good old Notepad](https://blogs.msdn.microsoft.com/commandline/2018/05/08/extended-eol-in-notepad/), we are going to treat carriage returns and line feeds as what they originally meant, rather than what they are (ab-)used for today.*
Given a string consisting of printable ASCII pl... |
[Question]
[
I'm one of the authors of Gimli. We already have a 2-tweet (280 chars) version in C but I would like to see how small it can get.
Gimli ([paper](https://ia.cr/2017/630),[website](https://gimli.cr.yp.to)) is a high speed with high security level cryptographic permutation design that will be presented at... |
[Question]
[
This challenge is inspired by the meme [Men of Culture](http://knowyourmeme.com/memes/ah-i-see-youre-a-man-of-culture-as-well).
The meme involves blanking out parts of the original caption,
>
> Ah, I see you're a man of culture as well.
>
>
>
to make it appear as if the character is saying somethin... |
[Question]
[
Given a rectangular matrix of elevations, draw its contours.
# Task
Two elements `x` and `y` are on the same contour level if `floor(x/10) == floor(y/10)`. For example, `52` and `58` are on the same contour level, but `58` and `64` are not.
The act of drawing contours is defined as follows:
For every e... |
[Question]
[
### Introduction
Arrays can also be seen as a field for a bouncing ball. This of course sounds very vague, so here is an example of an input:
```
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[9, 8, 7, 6, 5, 4, 3, 2, 1]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
```
The challenge is to output the **bounced arrays**. These are made fro... |
[Question]
[
sheesh, is this really the 4th? For all you oldcomers, the core challenge is the same, but we are using Java instead of a custom language. Here are the past [three](https://codegolf.stackexchange.com/questions/36978/whats-wrong-with-public-variables?rq=1) [CodeBot](https://codegolf.stackexchange.com/qu... |
[Question]
[
Let's represent a [standard masonry brick](http://en.wikipedia.org/wiki/Brick) as `[__]` (and ignore the fact that the top is open). When these bricks are stacked every other layer is offset by half a brick, as is usual in brick construction:
```
[__][__][__][__]
[__][__][__][__]
[__][__][__][__]... |
[Question]
[
[Wireworld](http://en.wikipedia.org/wiki/Wireworld) is a cellular automaton that was designed to be resemble electrons flowing through wires. Its simple mechanics allow the construction of digital circuits. It has even permitted the construction of an [entire computer](http://www.quinapalus.com/wi-inde... |
[Question]
[
**Setup:** For two sets \$A,B\$, we say \$A \subseteq B\$ if every element in \$A\$ is also in \$B\$.
Another way of saying this, is that we can order the elements of \$A,B\$ into two lists \$L\_A,L\_B\$, such that \$L\_A[i] = L\_B[i]\$ where \$i\$ ranges over the indices of \$L\_A\$.
We proceed to ext... |
[Question]
[
# Background
The [Look and Say Sequence](https://en.wikipedia.org/wiki/Look-and-say_sequence) is built up by reading off the digits of previous entries in the sequence, counting the number of digits in groups of the same digit. For example:
```
1 => 11 # (one 1)
11 => 21 # (two 1s)
21 => 1211 # (one 2,... |
[Question]
[
You are on a plane filled with boxes, and you get a sequence of movements, say "up right right down left":

You move up, pushing all boxes in front of you away:

```
or (if submission is a single byte – TIO will add a trailing s on the first line only if need... |
[Question]
[
You're given a hexagonal grid of the characters `.` and `#`, like this:
```
. . . . . . . .
. . . . # . . .
. # . . . # . .
. . . # . . . .
. . . . . # . .
. . . . . . . .
```
Your task is to fill the entire axis-aligned bounding box of the `#` with further `#`:
```
. . . . . . . .
. . # # # # .... |
[Question]
[
It's very easy:
Create a program without writing a single line of code. The code may only consist of existing Stack Overflow questions and answers.
The program should create two random numbers and output the numbers
* added to,
* subtracted from,
* multiplied with and
* divided by
each other.
**Rule... |
[Question]
[
## The background
My son Leonhard (4 years old) loves labyrinths. I don't know where he knows labyrinths from, but he paints them and knows quite well how they work:

Recently, he started making a game from his paintings. These are his rules:
* a black s... |
[Question]
[
Greetings, noble code golfers. Today you will resolve the most ancient and distinguished of debates - Emacs or Vim?
Your challenge is to take two search terms as input, and output which of those terms has the most Google search results. (This is obviously completely fair. What do you mean, biased?)
Her... |
[Question]
[
You've been hired by a bomb defusing company to perform some "controlled" demolition of un-exploded ordnance. You are given a list of bombs represented by non-negative integers.
```
[3,2,4,0,3,1,2]
```
Every step you can set up and explode a bomb. When a bomb \$n\$ explodes, it destroys all bombs withi... |
[Question]
[
In [Pascal's triangle](https://en.wikipedia.org/wiki/Pascal%27s_triangle) each number is the sum of the two numbers directly above it, treating empty spots as zero:
[](https://i.stack.imgur.com/E... |
[Question]
[
Two lists `A` and `B` are congruent if they have the same length, and elements that compare equal in `A` compare equal in `B`.
In other words, given any two valid indices `x` and `y`:
* If `A[x] = A[y]`, then `B[x] = B[y]`.
* If `A[x] != A[y]`, then `B[x] != B[y]`.
For example, the lists `[1, 2, 1, 4, ... |
[Question]
[
>
> Disclaimer: The story told within this question is entirely fictional, and invented solely for the purpose of providing an intro.
>
>
>
My boss has gotten a new toy robot, and he wants me to help program it. He wants to be able to enter simple arrow instructions to get it to move. These instru... |
[Question]
[
My parents have an home theater device. The remote is broken making it incredibly difficult to navigate rightwards in a menu. Most the time it doesn't work but when it does it moves rightwards incredibly quickly.
This is obviously frustrating but it is most frustrating when you want to enter a movie ti... |
[Question]
[
## Background
Alice and Bob are creating a golfing language to win every single PPCG challenge.
Alice wants to make a two-dimensional language, like ><>, but Bob prefers a prefix-infix syntax like in J.
As a compromise, they decide to create a two-dimensional prefix-infix language.
The parser is a pain... |
[Question]
[
Write a program that outputs the exact string:
```
jan ale o, toki!
```
*("Hello, world" but in toki pona to prevent builtins.)*
with an optional trailing newline.
Additionally when all copies of any one byte present in your program are removed the program must fail to produce a correct output no matte... |
[Question]
[
[Starry](http://esolangs.org/wiki/Starry) is a funny esoteric programming language in which code consists only of `+*.,`'` where the actual command represented by each of those characters is determined by the number of spaces in front of it. That makes it tricky even to golf fixed-output challenges, be... |
[Question]
[
Given a level from a simple platform game, your task is to make a program or function to determine if a level is winnable. Platform game levels are 4 characters tall and any number of characters wide. There is exactly one platform for each horizontal space in a level:
```
======= =
=... |
[Question]
[
A venerated pass time of pedants is to point out that pictures of "Rubik's Cubes" (on t-shirts, posters etc.) are not actually solvable.
The first thing that should be checked is that the cube is made up of the right pieces. To be solvable a cube needs six colors each with nine squares. The cube also n... |
[Question]
[
>
> [Brain-flak](https://github.com/DJMcMayhem/Brain-Flak) turns one year old tomorrow! In honor of it's birthday, we're having a PPCG style birthday party, where several users post brain-flak related questions! [Help us celebrate!](https://hackmd.io/KwRgnARiAcCGAsBaaEBMAGR8DG8Cmis0AZsVhPLOtsWAOzQAmIQ... |
[Question]
[
## Background
[Incident](http://esolangs.org/wiki/Incident) is a fairly unusual programming language, in that its list of tokens is not predetermined, but rather inferred from the input. As such, tokenising an Incident program can be fairly difficult, especially if you want to do so efficiently. This t... |
[Question]
[
Write a program or function that given two integers *a, b* outputs a string containing a decimal number representing the fraction *a/b* **exactly**.
If *a/b* is integer, simply output the value, without a decimal dot or leading zeroes:
```
123562375921304812375087183597 / 2777 -> 4449491390756385033312... |
[Question]
[
This challenge is about gradually shifting hues in an image to make pretty pictures like this:
[](https://i.stack.imgur.com/hDcQr.jpg)
([original](https://i.stack.imgur.com/XFKAg.jpg))
# Challenge
Write a program or function that takes in two non-... |
[Question]
[
Write a program that takes in a rectangular block of text made up of `X`'s and `.`'s, such as this rough `A`:
```
......
..XX..
.X..X.
.XXXX.
.X..X.
.X..X.
```
Output a representation of this grid rotated 45 degrees counterclockwise by drawing a slash — forward or backward depending on context — everyw... |
[Question]
[
## Introduction
Consider a sequence of integers and one of its subsequences, say **A = [4 2 2 4 4 6 5]** and **B = [2 4 5]**.
We want to remove the elements of **B** from **A** in order, and there are several ways of doing that:
```
A = 4 2 2 4 4 6 5
B = 2 4 5
-> 4 2 4 6
A = 4 2 2 4 4 6 5
... |
[Question]
[
Piano keys are 3 characters wide, and 7 characters tall. However, if *every* key was 3 charactes wide, there wouldn't be enough room for the black keys. That's why some of the white keys have parts of them cut out. There are 3 types of white keys.
Keys with the right half missing (R):
```
____
| |
| ... |
[Question]
[
## Challenge
Given guitar tablature you must output the song represented by the tab. This may be to the speakers of your computer or to an audio file (.wav, .mp3, .midi, .aiff, etc.). There will also be a second input for timing.
The tabs may be input via a file or straight to STDIN. The tab will be in... |
[Question]
[
Each character in this 64 by 64 block of text has been chosen randomly and uniformly from the 95 [printable ASCII](http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters) characters.
```
/rq$:Zy5*g'$DeGXX2o8y "{@Cg:FR9qih}xh >5$DsF1Fs5Ao~smFp;.RJbV )U
c4\(|Sx*V$10G9xO:NjHKasem%,\9[pPm@&kTaN~HC[;... |
[Question]
[
It is Halloween and [Jimmy](https://codegolf.stackexchange.com/search?tab=newest&q=is%3aq%20title%3ajimmy) (`/o\`) has gone into a mysterious neighborhood for trick-or-treating (ask himself why). Now some evil ghosts are chasing him. Can Jimmy escape the ghosts?
## Challenge:
**Input:**
A board showing... |
[Question]
[
Related to [this question](https://codegolf.stackexchange.com/questions/151501/how-lit-is-this-mountain).
A *room* is defined to be a (not necessarily convex) non-intersecting polygon, expressed as an ordered list of 2-dimensional coordinates. A sufficiently bright lightbulb is placed at a specific poi... |
[Question]
[
Given a possibly nested, non-empty array of single-digit positive integers (not guaranteed unique), output the ASCII-art representation as a tree, using the box-drawing characters `┌ ┴ ┐ ─ │ ┬ ┼`. (These were copied from Code Page 437, but you can use any equivalent representation).
Every integer of th... |
[Question]
[
## Buzzby Berkeley Robot Hokey Pokey
### Task
Write a program or function to produce an ASCII art animation depicting a line of robots dancing to the lyrics of the Hokey Pokey (or Cokey, if you prefer) in the style of a Busby Berkeley number!
### Example Output
[ is a classic board game with a compelling deduction gameplay
component. Speed Clue is a 3-6 player variant that emphasizes this component by
using only the cards. The result is that the only difference between standard
Cluedo and Speed Cl... |
[Question]
[
You are a secret agent trying to communicate with your fatherland. Of course the information needs to be hidden so no one eaves drops your message. What would be better suited than a cat? Everyone loves funny pictures of cats [citation needed], so they won't suspect secret information hiding in there!
... |
[Question]
[
Lighthouses on an island have blink codes that let ships know which lighthouse they are seeing. Input should be strings of S and L. Here is a (Python) example of codes for 4 lighthouses as a list of strings:
```
['SLS', 'SLL', 'SSS', 'LSL']
```
where:
S = short ON (1 sec)
L = long ON (3 sec)
Long and... |
[Question]
[
When writing [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") programs, I usually end up using some numeric constants. I always put them in decimal because that's how I think, but I just realized that my language supports other number formats that might let me shorten my cod... |
[Question]
[
An [Abjad](https://en.wikipedia.org/wiki/Abjad) is a writing system where each symbol stands for a consonant, and where vowels are omitted. An impure Abjad is an abjad in which there are additionals symbols for vowels, usually diacritics.
Write a program or function that, given a string of lowercase te... |
[Question]
[
disclaimer: I'm not aware of any non-bruteforce solutions
A Graeco-Latin square is, for two sets of same length \$n\$, a \$n \times n\$ arrangement of cells, each containing a unique (across the entire square) pair of a element of the first set and a element of the second set, such that all first ele... |
[Question]
[
Many old [**Game Boy**](https://en.wikipedia.org/wiki/Game_Boy_line) games often required string input from the user. However, there was no keyboard. This was handled by presenting the user with a "keyboard screen" like so:
[](https://i.stack... |
[Question]
[
Who will rule the realm?
You are given a family tree which contains: name, sex, date of birth, date of death and a list of heirs, for each family member. You may use any convenient (nested) list format to represent the tree. The following examples will use JSON. Determine who will rule the realm and in... |
[Question]
[
For the purpose of this challenge, we say that a regex pattern matches a string if the *entire* string is matched by the pattern, not just a substring.
Given two regex patterns *A* and *B*, we say that *A* is **more specialized** than *B* if every string that is matched by *A* is also matched by *B* ... |
[Question]
[
## Intro
You are sitting in a board room at the end of a long table. You look around and see Tim Cook, the Apple Board of Directors, the ghost of Steve Jobs, and Jack Donaghy. Apple has called this meeting because they have realized how much cooler the Android lock screen is, and they want to 1-UP them... |
[Question]
[
You are given the functions: h1(f,\*args) and h2(f,\*args)
Both are methods which are already defined for you (here the asterisk indicates a variable number of arguments)
f is a function, \*args is a list of parameters to be passed to that function
h1 returns a boolean value: True if the function f eve... |
[Question]
[
I'm looking to find the fastest racer around. Show me your fastest lap around this 18x14 track shown below.
```
______
/ \
/ \
/ ____ \
/ / \ \
/ / \ \
| | | |
| | | |
| | | |
| | | |
\ \ / /
\ ... |
[Question]
[
**Update:** There are 6 mazes. They are included in the controller. There is a tar.gz of the mazes and their .bmp files [here](https://www.dropbox.com/s/kmlak8qvjdjk99i/mazes.tar.gz?dl=0) (dropbox). There is also a utility for making more mazes at that link (the maze\_4.txt file is incorrect in archive... |
[Question]
[
Math has a lot of symbols. Some might say too many symbols. So lets do some math with pictures.
Lets have a paper, which we will draw on. To start the paper is empty, we will say that is equivalent to \$\top\$ or \$\textit{true}\$.
If we write other things on the paper they will also be true.
For examp... |
[Question]
[
## Rectangle covers
Suppose you have a matrix of bits, for example the following.
```
1 1 0 0 0 1 1 0
1 1 1 1 0 1 1 1
0 1 1 1 0 1 1 1
1 1 0 1 1 1 1 0
1 1 0 1 1 1 0 1
```
We would like to find a *rectangle cover* for this matrix.
It is a set of rectangular subsets of the matrix that don't contain any 0s... |
[Question]
[
Write a program or function that takes in a positive integer \$N\$ and a grid of decimal digits (\$0\$ to \$9\$) with width \$W\$ and height \$H\$ (which are also positive integers). You can assume that \$N\$ will be less than or equal to the larger of \$W\$ and \$H\$ (\$N \le \max(W,H)\$).
Print or re... |
[Question]
[
# Introduction
Recently, I was skyping with a bunch of friends and we got bored and had nothing to do, so we "invented" a "game" (some people in the comments pointed out that this game is playable online and very popular, so we definetely didn't invent it, although I hadn't seen it before). The reason ... |
[Question]
[
Do you ever look at 3D shapes and think that we have 2 many dimensions. So let's make 3D into 1D! (See what I did there?)
# Task
Given a 2D representation of a cube (layout below), flatten it into a single string, based on pointers.
# The CUBE
This is the layout of the cube filled with no-ops (`,`) and... |
[Question]
[
Given an integer `n` output the `n`th iteration of the [Hilbert Curve](https://en.wikipedia.org/wiki/Hilbert_curve) in ASCII using the characters `_` and `|`.
Here are the first 4 iterations:
```
n=1
_
| |
n=2
_ _
| |_| |
|_ _|
_| |_
n=3
_ _ _ _
| |_| | | |_| |
|_ _| |_ _|
_| |___... |
[Question]
[
And in particular the [second law](https://en.wikipedia.org/wiki/Second_law_of_thermodynamics): *the entropy of an isolated system undergoing an irreversible process increases with time*.
For this challenge,
* An "*isolated system*" will be taken to be a *program or function* (abbreviated as "program" ... |
[Question]
[
In light of the 2014 Australian Open in Melbourne, and the win by Stanislas Wawrinka against Novak Djokovic, I propose the following code golf challenge!
Wawrinka and Djokovic are at it again for the basis of this CGC. Your challenge is to take a string consisting of 1's and 2's and determine the tenni... |
[Question]
[
Given a sequence of the bases Adenine, Cytosine, Guanine and Thymine (encoded as `ACGT`), you're to produce an ASCII art representation of a corresponding double strand of DNA.
The strand will extend vertically. The left-hand strand is the one you are given as input. The right-hand strand will be its c... |
[Question]
[
Your goal is to print the lyrics to the song "Twinkle Twinkle Little Star" as each note is played.
The computer's microphone will hear notes. If the pitch (but not necessarily the length) of the note is correct, print the appropriate syllable. Otherwise, do nothing. Each note will be at least half a se... |
[Question]
[
### Background
As noted in the PPCG challenge [Compress a maximal discrepancy-2 sequence](https://codegolf.stackexchange.com/q/122304/12012) – which inspired this challenge – the authors of the paper [Computer-Aided Proof of Erdős Discrepancy Properties](https://arxiv.org/pdf/1405.3097v2.pdf) found a m... |
[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]
[
This is the robbers' thread. The cops' thread [goes here](https://codegolf.stackexchange.com/questions/99546/code-ladder-cops).
Write a code that has the same number of bytes as the cop post and where the revealed characters are identical. The code must produce `1` in its initial state, and produce the... |
[Question]
[
Your challenge is to find the file extension of a provided filename:
```
hi.txt -> txt or .txt
carrot.meme -> meme or .meme
lol (undefined behavior)
what..is..this..file -> file or .file
.bashrc -> bashrc or .bashrc
[[email protected]](/cdn-cgi/l/email-protection)[]h -> h0wC[]h or .h0wC[]h
agent.000 ->... |
[Question]
[
Rearrange a given list such that all the odd numbers appear before all the even numbers. Besides for this requirement, the output list may be in any order.
The input will only contain integers, but they may be negative and there may be duplicates, and they may appear in any order.
Shortest solution win... |
[Question]
[
Create a window that says hello world inside and nothing else. You can not have any ok or cancel buttons inside. It must be just a plain window that says hello world. I do not care about the contents of the window frame or how the window looks, but inside it must say hello world only.
Example:
![ente... |
[Question]
[
With roughly one second (plus or minus 10 ms) between outputs, output anything.
The first output must be at most one second after the start of the program, but can be as soon as right when the program starts.
So, the first output can be up to a second after the program starts, the second exactly on... |
[Question]
[
Draw an ASCII-art rainbow!
# Input
An integer between 0 and 1000, inclusive.
# Examples
Input 0:
```
/\
||
```
Input 1:
```
_
/ \
| |
```
Input 2:
```
__
/ \
| |
```
Input 3:
```
___
/ \
| |
```
The first row is a space followed by *n* underscores.
The second row is a slash followed by *n* spa... |
[Question]
[
It is common to start countdowns 100 days prior to an event, probably because of our base 10 system. Examples of this can be found everywhere:
* 100 days until your birthday
* 100 days until the wedding
* 100 days until the election
* 100 days until our graduation
* 100 days until her due date
* 100 da... |
[Question]
[
**This question already has an answer here**:
[Find the square root, BUT [closed]](/questions/71477/find-the-square-root-but)
(1 answer)
Closed 8 years ago.
Define a function, s, which takes a number and returns the square root.
No use of library functions, such as Java's Math.sqrt() or PHP's bu... |
[Question]
[
[`zipwith`](http://zvon.org/other/haskell/Outputprelude/zipWith_f.html) is a functional construct that takes three arguments: one binary function and two lists of the same length, and returns a single list where each element is constructed by applying the binary function to each pair of elements from t... |
[Question]
[
Given a positive integer `N`, output the smallest positive integer such that this number is a palindrome (i.e. is its own reverse) and is divisible by `N`.
The palindrome (i.e. the output) must not need a leading zero to be a palindrome, e.g. `080` is not the valid answer for `16`.
The input will never... |
[Question]
[
Given an integer **n** ≥ 1, output a 2D representation† of a percent sign of width **n**. The construction goes as follows:
1. Create an **n** by **n** matrix (or list of lists) filled with zeroes.
2. Insert ones in the top-left and bottom-right corners.
3. Place ones on the diagonal from the bottom-le... |
[Question]
[
### Inspired by the fact that a few related challenges to this could be answered by Vyxal in 0 Bytes using a special flag combination.
Given only one input integer \$n\$, calculate \$f(n,n)\$ where
$$ f(x,y)=
\begin{cases}
x & \text{if } y=0 \\
f(\left(\sum\_{k=1}^xk\right),\text{ }y-1) & \text{otherwi... |
[Question]
[
Inspired by [this question on SO](https://stackoverflow.com/q/23047198/916299), your task is to produce a program that is valid in (at least) two major versions of your chosen language that produce different output.
## Rules
* Any language that has more than one major version can be used.
+ For the pu... |
[Question]
[
The **minmod** function is a variant of the familiar **min**, which appears in slope-limiting high-resolution schemes for partial differential equations. Given a number of slopes, it picks out the flattest slope, while taking care of relative signs between the slopes.
The function takes an arbitrary nu... |
[Question]
[
Your task is to print this exact text:
```
אבגדהוזחטיכךלמםנןסעפףצץקרשת
```
(You are allowed to print a trailing newline)
SHA256 hash of the UTF-8 encoding of the text:
```
0ab6f1e0bf216a0db52a4a5a247f95cba6f51496de7a24dfd01f3985dfcf6085
```
Base64 encoding:
```
15DXkdeS15PXlNeV15bXl9eY15nXm9ea15zXnted1... |
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.