text stringlengths 180 608k |
|---|
[Question]
[
Given an integer 2n, find the number of possible ways in which 2n^2 black pawns and 2n^2 white pawns can be arranged on a 2n by 2n chess board such that no pawn attack another.
* A black pawn can attack only a white pawn, and vice versa.
* The usual chess rules of attacking follow, i.e, white pawns att... |
[Question]
[
**Note:** This isn't as much a golfing challenge; it is more so asking for golfing suggestions.
Recently I had a Python assignment for my web development class, in order to check whether we could code. Since I already feel comfortable in Python, I decided to try and golf it, and I was wondering if peop... |
[Question]
[
**Create a function or program that makes a grid as close to an square as possible**
* You will be given an integer *N* as input, whole numbers (1,2,3,25, etc)
* The output must be a perfect rectangular grid of *N* letters as close to a square as possible
* The (wannabe)square must consist of one of th... |
[Question]
[
In mathematics, tetration is the next hyper operator after exponentiation, and is defined as iterated exponentiation.
**Addition** (***a*** succeeded ***n*** times)

**Multiplication** (***a*** added to itself, ***n*** times)

The challenge is fairly simple:
1. Take a string of numerals
2. Find and print the largest contiguous prime number in the st... |
[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/16826/edit).
Closed 2 years ago.
[Improve this question](/posts/16826/edit)
... |
[Question]
[
## Background
In Western music, every single music note has an assigned name. Within each octave, there are twelve unique notes in the following order: "C C#/Db D D#/Eb E F F#/Gb G G#/Ab A A#/Bb B C", where the final C is one octave above the first.
To tell the difference between notes of different oc... |
[Question]
[
# Objective
Given the distance between two keys in an octave, identify its name.
But there's a caveat. In this challenge, there are [22](https://en.xen.wiki/w/22edo) keys in an octave, not usual 12.
Here, a [porcupine[7] scale](https://en.xen.wiki/w/Porcupine) will be assumed.
# Mapping
White keys are ... |
[Question]
[
Part of [**Code Golf Advent Calendar 2022**](https://codegolf.meta.stackexchange.com/questions/25251/announcing-code-golf-advent-calendar-2022-event-challenge-sandbox) event. See the linked meta post for details.
---
[You successfully route the laser into the sensor](https://codegolf.stackexchange.com/... |
[Question]
[
In the game [Pickomino](https://www.boardgamegeek.com/boardgame/15818/pickomino), there are several tiles lying in the middle of the table, each with a different positive integer on them. Each turn, the players roll dices in a certain way and get a score, which is a nonnegative integer.
Now the player ... |
[Question]
[
A little known fact is that if you turn on enough language extensions (ghc) Haskell becomes a dynamically typed interpreted language! For example the following program implements addition.
```
{-# Language MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances #-}
data Z... |
[Question]
[
Yes is a stack-based ~~language~~ that has a few space-separated instructions:
```
yes: Push 1 to the stack
no: Push 0 to the stack
what: Push the input to the stack (input is taken at the start of program execution and is the same for the whole execution)
sure: Increment the last item in the stack
nah... |
[Question]
[
[April 5th](http://www.nationaldaycalendar.com/national-deep-dish-pizza-day-april-5/) is National Deep DIsh Pizza Day, the theme of this challenge. Given a positive integer `n` (`n` is greater than 0), create an ASCII deep dish pizza. Actual deep dish pizza shown:
[ random line segments of uniform length (`l`), check if they cross the equidistant (`t`) parallel lines.
## Simulation
**What are we simulating?** [Buffon's needle](https://en.wikipedia.org/wiki/Buffon's_needle). Smooth out the sand in your sandbox, draw a set of equally spaced pa... |
[Question]
[
The [Chinese Remainder Theorem](https://en.wikipedia.org/wiki/Chinese_remainder_theorem) can be quite useful in modular arithmetic.
For example, consider the following set of congruence relations:
[](https://i.stack.imgur.com/qHvYd.gif)
For sets ... |
[Question]
[
This challenge is very simple. You are given as input a square matrix, represented in any sane way, and you have to output the dot product of the diagonals of the matrix.
The diagonals in specific are the diagonal running from top-left to bottom-right and from top-right to bottom-left.
# Test Cases
```... |
[Question]
[
This is a code-golf question.
Given integers s and n the task is to output all arrays of length n which take values from -s to s. The only twist is that you must output them in the following order.
* The all zeros array of length n.
* All arrays of length n with elements from -1 to 1 excluding any arr... |
[Question]
[
In Skyrim, the player character can use powerful magic shouts (Thu'ums) to achieve their goals. Every shout consists of three words, however, the player can use the first one or two words to achieve the same effect with less power but at a shorter cooldown.
Given a lowercase ASCII Thu'um phrase **witho... |
[Question]
[
# Intro
Consider the process of taking some positive integer *n* in some base *b* and replacing each digit with its representation in the base of the digit to the right.
* If the digit to the right is a 0, use base *b*.
* If the digit to the right is a 1, use [unary](http://en.wikipedia.org/wiki/Unary_... |
[Question]
[
A string is [squarefree](http://en.wikipedia.org/wiki/Squarefree_word) if it contains no substring twice in a row.
It is possible to have an arbitrarily long squarefree word using a 3-letter alphabet.
Write a program which accepts a positive integer n from stdin and prints any squarefree word of length... |
[Question]
[
In these previous challenges[[1]](https://codegolf.stackexchange.com/q/249026/)[[2]](https://codegolf.stackexchange.com/q/248966/) I've been dealing with "mushroom forests". To help with these I draw little diagrams of the forests to help. In this challenge we are going to reverse engineer the data fro... |
[Question]
[
## The Narrative
You are a bad musician. You never bothered to learn how to count rhythms. To remedy this shortcoming, you decide to write a program that will tell you how to count in any given time signature. You are still a bad musician, but you can at least pretend that you can count rhythms.
## The... |
[Question]
[
Given an unordered list of musical pitches, write the shortest program/function (scored in bytes) to sort the list from lowest pitch to highest.
Pitches will be given in [scientific pitch notation](https://en.wikipedia.org/wiki/Scientific_pitch_notation), consisting of a tone name followed by an octave... |
[Question]
[
## Introduction:
[Beckett Grading Service (aka BGS)](https://www.beckett.com/grading), is a company which encapusulates and grades Trading Card Game (TCG) cards (i.e. sport cards, Magic The Gathering, Pokémon, Yu-Gi-Oh, etc. etc.). The TCG cards that come in for grading will be checked on four categori... |
[Question]
[
### Challenge:
Output all distinct permutations of a, potentially long, list of positive integers. You may assume that the vector has less than 1,000 numbers when testing, but the process should in theory work for any vector with more than one number regardless of size.
**Restrictions:**
* You must res... |
[Question]
[
Write a program/function/script that takes a natural number i from 1 to 10 as input and outputs the URL of the Question with the i th hottest question on the Code Golf Portal
The ordering should be like in <https://codegolf.stackexchange.com/?tab=hot>.
For example:
*input 1*
*output [https://codeg... |
[Question]
[
These are raindrops:
```
! | . " :
```
These are clouds particles:
```
( ) _ @ $ &
```
I want you to verify, when given a block of text, whether or not it is raining. It is raining if, for every raindrop, there is a cloud particle somewhere above it. There must be one cloud particle for every raindrop.... |
[Question]
[
Part of [**Code Golf Advent Calendar 2022**](https://codegolf.meta.stackexchange.com/questions/25251/announcing-code-golf-advent-calendar-2022-event-challenge-sandbox) event. See the linked meta post for details.
---
I've got an infinite supply of \$n\$-dimensional chocolate for some positive integer \... |
[Question]
[
This is OEIS sequence [A055397](https://oeis.org/A055397).
In Conway's Game of life, a **still life** is a pattern that does not change over time. We can see from the rules of Conway's Game of life that, a pattern is a still life if and only if:
* every living cell has exactly two or three living neigh... |
[Question]
[
The title is an homage of the [Natural Number Game](https://wwwf.imperial.ac.uk/%7Ebuzzard/xena/natural_number_game/), which is a nice interactive tutorial into proving certain properties of natural numbers in Lean.
Given that the [previous](https://codegolf.stackexchange.com/q/236105/78410) [two](http... |
[Question]
[
If 1 is not counted as a factor, then
* 40 has two neighboring factors (4 and 5)
* 1092 has two neighboring factors (13 and 14)
* 350 does not have two neighboring factors
(out of its factors 2, 5, 7, 10, 14, 25, 35, 50, 70, and 175,
no two are consecutive)
The proportion of positive integers that have... |
[Question]
[
### Given a German string and an indication of a case (lower/upper/title), fold the string to that case.
## Specifications
1. Input will consist only of `a`–`z` plus `äöüß-,.;:!?'"` in uppercase and/or lowercase.
2. The target case may be taken as any three unique values (please specify what they are) ... |
[Question]
[
In the misty years of yore, when fanfold terminals walked the earth, there lived a strange creature. Oddly crippled and yet oddly powerful, the line editor teemed across the programming landscape in untold numbers; covering the earth as far as the eye could see.
Now it is fallen on hard times. That vas... |
[Question]
[
# The Task
In this challenge, your task is to write a program, which takes in no input, with as many anagrams that are quine of themselves as possible.
Your score will be the number of anagrams of your program's source code that are valid quines divided by the total number of anagrams possible, i.e. th... |
[Question]
[
# Challenge
Given a user's **name** (not ID, we have that challenge already), output their current reputation and their ID.
### Input
Input will be a single string which is the user's username. You may assume that this user exists.
### Output
Output will be two integers to either STDOUT or STDERR which... |
[Question]
[
A [constructible \$n\$-gon](https://en.wikipedia.org/wiki/Constructible_polygon) is a regular polygon with n sides that you can construct with only a compass and an unmarked ruler.
As stated by Gauss, the only \$n\$ for which a \$n\$-gon is constructible is a product of any number of distinct Fermat pr... |
[Question]
[
# Definition
The chain rule with two functions state that:
```
D[f(g(x))] = f'(g(x)) * g'(x)
```
Or, alternatively:
```
D[f1(f2(x))] = f1'(f2(x)) * f2'(x)
```
The chain rule with three functions state that:
```
D[f(g(h(x)))] = f'(g(h(x))) * g'(h(x)) * h'(x)
```
Or, alternatively:
```
D[f1(f2(f3(x)))] =... |
[Question]
[
A person has to complete `N` units of work; the nature of work is the same.
In order to get the hang of the work, he completes only **one unit of work in the first day**.
He wishes to celebrate the completion of work, so he decides to complete **one unit of work in the last day**.
He is only allowed to... |
[Question]
[
Your task is to analyse the input and output the formula for the n-th term if it is an arithmetic sequence, otherwise it should print "NAAP".
---
## Input
Input (from STDIN) will consist of few numbers, between 4 to 10 numbers where each number will be in the range between -1000 and 1000 inclusive, sep... |
[Question]
[
(Continuing on the number sequences code-golf, here is an interesting sequence)
Eban Numbers ([A006933](http://oeis.org/A006933)) are the sequence of numbers whose names (in English) do not contain the letter "e" (i.e., "e" is "banned")
The first few numbers in the sequence are:
```
2, 4, 6, 30, 32, 34... |
[Question]
[
Text may be translated to a written version of [TUT language](http://www.tutlanguage.com/pages/amSpeech.html) by replacing each letter by the corresponding "TUT word", as given in the following table (adapted from the linked article)\*:
```
a e h hash o o u yu
b bub i ay ... |
[Question]
[
## Introduction
You are given a random integer generator with the following implementation
* The first invocation always returns 1.
* The second invocation returns a random integer between 1 and 2.
* The third invocation returns a random integer between 1 and 3.
* The nth invocation returns a random in... |
[Question]
[
As the title says, given a valid chess move in algebraic notation, produce the string describing the move.
**Example:**
```
fxg8=Q+ -> Pawn takes g8 promotes to Queen check
Bb7# -> Bishop to b7 mate
```
Here is a list of all the keywords and their respective notation
```
R -> Rook ... |
[Question]
[
Given a string `s` consisting of characters a-z lowercase, generate 5 arrays `a1`, `a2`, `a3`, `a4`, and `a5` of size `n` (length of `s`) where the `i`-th element of each array represents the index of the next occurrence of the `i`-th character in `s`, with the following conditions:
* If no such occurr... |
[Question]
[
# Introduction
Time is a really simple concept. Seconds pass, one after the other, all the same. But humans love making it hard. [This Stackoverflow question](https://stackoverflow.com/questions/6312993/javascript-seconds-to-time-string-with-format-hhmmss/43466724#43466724) has gathered many answers an... |
[Question]
[
You are probably familiar with the Cartesian product. It takes two lists and creates a list of all pairs that can be made from an element of the first and an element from the second:
\$
\left[1,2\right] \times \left[3,4\right] = \left[(1,3),(1,4),(2,3),(2,4)\right]
\$
Here the order of the result is su... |
[Question]
[
## Lexicographic Ordering
For this challenge we will be talking about the lexicographic ordering of strings. If you know how to put words in alphabetical order you already understand the basic idea of lexicographic ordering.
Lexicographic ordering is a way of ordering strings of characters.
When compar... |
[Question]
[
A challenge many developers face when drawing a graph from scratch to plot some data is generating its ticks. In below graph, there are 6 horizontal ticks (1750, 1800, 1830, 1860, 1880 and 1900) and 11 vertical ticks (0, 10, 20, 30, 40, 50, 60, 70, 80, 90 and 100).
[![Relative share of world manufactur... |
[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 2 years ago.
[Improve this quest... |
[Question]
[
# Golf Golf!
This is my first challenge, so please be gentle! The challenge is to write a program that will output the correct score for a layout in the card game "Golf."
The card game Golf has many variations. The house rules I use follow the [standard rules for Six-Card Golf](https://www.pagat.com/dr... |
[Question]
[
An [H tree](https://en.wikipedia.org/wiki/H_tree) is a fractal tree structure that starts with a line. In each iteration, T branches are added to all endpoints. In this challenge, you have to create an ASCII representation of *every second* H tree level.
The **first level** simply contains three hyphen... |
[Question]
[
This challenge is for the largest finite number you can get BrainFuck programs of given lengths to contain in memory.
We must use one of the BF versions that uses big integers for the cells rather than byte values as not to be capped at 255. Do not use negative positions and values in memory. Do not us... |
[Question]
[
A function is said to have a *cycle of length n* if there exists an *x* in its domain such that *fn(x) = x* and *fm(x) ≠ x* for *0 < m < n*, where the superscript *n* denotes *n*-fold application of *f*. Note that a cycle of length *1* is a fixed point *f(x) = x*.
Your task is to implement a [*bijectiv... |
[Question]
[
# The Challenge
In this challenge you have to do two different (but related) tasks depending of the order of the input.
Your program will recieve a string `s` and an integer `n` as input and will
* split `s` into pieces of length `n` if `s` comes first. The last element will be shorter if necessary.
... |
[Question]
[
## Background
The Fibonacci tiling is a tiling of the (1D) line using two segments: a short one, *S*, and a long one, *L* (their length ratio is the golden ratio, but that's not relevant to this challenge). For a tiling using these two prototiles to actually be a Fibonacci tiling, the following conditi... |
[Question]
[
Your job is to take this number as input (although it should work with any other number too):
```
1834957034571097518349570345710975183495703457109751834957034571097518349570345710976183495703457109751834957034571097518349570345710975183495703457109751834957034571097618349570345710975183495703457109751... |
[Question]
[
This is a model of a forgiving HTML parser. Instead of parsing HTML and extracting attributes, in this code golf, the tag parser will be simple.
Write a function that parses a tag structure and returns its parenthized form.
An opening tag consists of one lowercase letter, and a closing tag consists of ... |
[Question]
[
Following the great advice (what do you mean *it's not advice*?!) on [Adding unnecessary fluff](https://codegolf.meta.stackexchange.com/a/9384) we can devise the following task:
* Take a list of positive integers and a positive integer \$m\$ as input.
* Only keep the prime values from the list.
* Defin... |
[Question]
[
[The explanations of the algorithm come from [here](https://publications.mfo.de/bitstream/handle/mfo/3940/snapshot-2022-002.pdf?sequence=1&isAllowed=y). I recommend reading it for a beautiful description of the algorithm.]
This challenge is to implement the Robinson Schensted correspondence.
# Input
A ... |
[Question]
[
# Let's go for a rollercodester ride
The objective of this challenge is to create a program that is run recursively through several languages of your choice. The output of the first iteration becomes the code for the second iteration, et. cetera.
* You choose the language sequence, but each **unique** ... |
[Question]
[
**This question already has answers here**:
[[Br]eaking Code Golf [Ba]d](/questions/112608/breaking-code-golf-bad)
(3 answers)
Closed 3 years ago.
The TV series "Breaking Bad" replaced the letters Br and Ba with a periodic-table like representation, printing `[Br35]eaking [Ba56]d`.
Create a prog... |
[Question]
[
# Input
The input will be a year between 1583 and 2239. We just want to know when [Hannukah](https://en.wikipedia.org/wiki/Hanukkah) was or will be in that year. This is information used by millions of people every year and put in calendars across the world. What could be easier?
# Output
The Gregorian... |
[Question]
[
[Shikaku](https://en.wikipedia.org/wiki/Shikaku) is a 2D puzzle. The basic rundown of it is that a rectangular grid has some numbers in it, and you want to partition the grid into rectangular components such that each component contains exactly one number which is the number of grid squares in that com... |
[Question]
[
Inspired by [*Display a chain of little mountains with an odd number on the top of it!*](https://codegolf.stackexchange.com/questions/100858/display-a-chain-of-little-mountains-with-an-odd-number-on-the-top-of-it) by [@sygmei](https://codegolf.stackexchange.com/users/62626/sygmei).
Why have a chain of ... |
[Question]
[
Given a directory (such as `C:/`), given from stdin or read from a file, produce a directory tree, with each file/folder indented based on its depth.
### Example
If I have a `C:/` drive which only contains two folders `foo` and `bar`, and `bar` is empty while `foo` contains `baz.txt`, then running wit... |
[Question]
[
For each integer *n*, 0 or higher, output the lowest power of 2 that has two identical sub-strings of *n* digits in decimal, and the two indices where the digit sub-strings start (0-based).
>
> **n Output Proof (don't output this)**
>
> 0 => 0 [0 1] (**\_**1 & 1**\_**)
>
> 1 =... |
[Question]
[
## Challenge
In the shortest amount of code:
1. Compute the length of the permutation cycle of a perfect shuffle on a deck of cards of any size *n* (where *n* ≥ 2 and *n* is even).
2. Output a table of all cycle lengths for 2 ≤ *n* ≤ 1000 (*n* even).
Note that there are two basic ways of defining a per... |
[Question]
[
In the spirit of the holidays, and as someone already started the winter theme([Build a snowman!](https://codegolf.stackexchange.com/questions/15648/build-a-snowman)) I propose a new challenge.
Print the number of days, hours, minutes, and seconds until Christmas(midnight(00:00:00) December 25th) on a ... |
[Question]
[
## Task
>
> Make a simple IRC bot which does simple task like greeting user.
>
>
>
## Detail
(You may see [this RFC document](https://www.rfc-editor.org/rfc/rfc2812).)
Write a complete program that perform these:
1. The program inputs `nickname` and `realname` from the user.
* All `nickname` and `r... |
[Question]
[
In R print(x, digits=n) does something a little complicated.
It always shows all the digits to the left of the decimal point and then, if there are any digits to the right it rounds the whole number so that at most n digits are shown. However, leading 0s are not counted. Here are examples to show how t... |
[Question]
[
The [Fabius function](https://en.wikipedia.org/wiki/Fabius_function) is an example of a function that is infinitely differentiable everywhere, yet nowhere analytic.
One way to define the function is in terms of an infinite number of random variables. Specifically, given a sequence of independent random... |
[Question]
[
## Challenge
Create the image of a [progress pride flag](https://en.wikipedia.org/wiki/Rainbow_flag_(LGBT)#Variations).
## Output
[](https://i.stack.imgur.com/kuKsw.png)
## Dimensions
[](https:/... |
[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/235843/edit).
Closed 2 years ago.
This post was edited and submitted for revi... |
[Question]
[
## Background
We all know about distributivity, i.e. \$a(b+c) = ab + ac\$. This is a property on *2* different operations, namely addition and multiplication. But indeed, nothing can stop us from studying distributivity of 1 operation. In this challenge, you will be studying a kind of left-distributive... |
[Question]
[
A *wave* of power \$k\$ is an infinite array that looks like \$1,2,\dots,k,k-1,\dots,1,\dots,k,\dots,1,\dots\$, and so on.
For example, a wave of power 3 starts with \$1,2,3,2,1,2,3,2,1,...\$, and repeats indefinitely. A wave of power 1 is an infinite array of ones. They happen to be beautifully expres... |
[Question]
[
*Related: Rather similar (but much easier) challenge horizontally: [There I fixed it (with tape)](https://codegolf.stackexchange.com/questions/157240/there-i-fixed-it-with-tape)*
## Challenge:
Given a string only containing upper- and/or lowercase letters (whichever you prefer) and new-lines, put `rope... |
[Question]
[
Standardized testing usually comes with a scan-tron or some type of answer document that records your answer. A computer or human(s) would then check your answers and determine your grade. So here, given a scan-tron and the answer key, determine the score and questions missed if any. A scan-tron is jus... |
[Question]
[
**This question already has answers here**:
[Smallest palindrome divisible by the input](/questions/91023/smallest-palindrome-divisible-by-the-input)
(41 answers)
Closed 7 years ago.
# Goal:
Given any non-zero natural number `a`, find the smallest non-zero natural
number `b` such that `a•b` is p... |
[Question]
[
The goal is simple: Output a nonzero real solution `x` to the equation `sin(x) = -mx`, given input `m`, in the fewest number of bytes.
Specifications:
* Your answer must be correct to 3 significant figures.
* You may output any real solution other than the trivial solution `x=0`. You can assume `m` is... |
[Question]
[
Your task is to create a program that adds random numbers to previous sums in the ultimate number racing showdown.
Each racer (column) starts at 0 and adds either 1 or 0 to the previous sum at each step of the race until all of the racers reach the score required to win. The 1 or 0 should be chosen at ... |
[Question]
[
The Knödel numbers are a set of sequences. Specifically, the Knödel numbers for a positive integer \$n\$ are the set of composite numbers \$m\$, such that all \$i < m\$, [coprime](https://en.wikipedia.org/wiki/Coprime_integers) to \$m\$, satisfy \$i^{(m-n)} \equiv 1 \mod m\$. The set of Knödel numbers ... |
[Question]
[
You should write a program or function which receives a list of digits as input and outputs or returns the largest sum achievable by putting these digits in a square.
Input will always contain a square number of digits. An example square arrangement for the input `9 1 2 3 4 5 6 7 7` could be
```
677
94... |
[Question]
[
>
> Alak was invented by the mathematician A. K. Dewdney, and described in his 1984 book Planiverse. The rules of Alak are simple:
>
>
> Alak is a two-player game played on a one-dimensional board with eleven slots on it. Each slot can hold at most one piece at a
> time. There's two kinds of pieces... |
[Question]
[
Let's try this again.
The object of this contest is to make two pieces of code that are anagrams of each other (the two must contain the same bytes in a different order), and they will do the following tasks:
* One must test if an inputted number is [happy](http://en.wikipedia.org/wiki/Happy_number) or... |
[Question]
[
Farmer Jack is very poor. He wants to light his whole farm but with minimum of cost. A lamp can illuminate its own cell as well as its eight neighbors . He has arranged the lamps in his field but he needs your help in finding out whether or not he has kept any extra lamps.
Extra lamps : Lamps which on ... |
[Question]
[
**This question already has answers here**:
[Code the Huffman!](/questions/61903/code-the-huffman)
(7 answers)
Closed 8 years ago.
Write a filter that converts text from standard input to a representation of its [Huffman tree](http://en.wikipedia.org/wiki/Huffman_coding) on standard output. In a... |
[Question]
[
Write a program that accesses [Project Gutenberg's KJV Bible](https://gutenberg.org/cache/epub/10/pg10.txt), either from a file called `pg10.txt` in the working directory or in any other way that is typical for the language, takes a Bible verse reference as input, and prints the corresponding verse, wi... |
[Question]
[
We already have a [challenge](https://codegolf.stackexchange.com/q/151436/9288) for polynomial interpolation: given a list of points, output the coefficients of the polynomial that passes through them.
[Hermite interpolation](https://en.wikipedia.org/wiki/Hermite_interpolation) is a generalization of p... |
[Question]
[
I am trying to write a solution to the following problem using as few characters as possible (to meme my friend and introduce him to golfing). Can any improvements be done to my code?
So the problem requires us to write a function called `navigate` in Python 3.6 (language of the judge, sorry, no walrus... |
[Question]
[
## Background
The [4-8-8 tiling](https://en.wikipedia.org/wiki/Euclidean_tilings_by_convex_regular_polygons#Archimedean,_uniform_or_semiregular_tilings) looks like this:

For the purpose of this challenge, we take the orientation of the tiling as exactly shown ab... |
[Question]
[
Given a positive integer \$n\$, output \$n\$ 2D bool images with the same width and height such that:
1. Each image should be 4-connected, i.e. for each two pixels that are true, you can start from one and go up, down, left and right for some times to the other pixel, only passing through true pixels.
... |
[Question]
[
# Objective
Given a matrix of **connected** box drawing characters, count its [genus](https://en.wikipedia.org/wiki/Genus_(mathematics)), the number of plane sections it encloses.
# Valid input
The box drawing characters are `─│┌┐└┘├┤┬┴┼╴╵╶╷` (U+2500 U+2502 U+250C U+2510 U+2514 U+2518 U+251C U+2524 U+2... |
[Question]
[
## Introduction
I can type at a moderate pace, using the QWERTY keyboard layout. But if a word like [yellowwooddoor](https://puzzling.stackexchange.com/questions/7875/what-is-the-english-word-with-the-longest-number-of-consecutive-repeated-letters) has a ton of repeated letters, it takes a bit longer t... |
[Question]
[
Given the sequence [OEIS A033581](http://oeis.org/A033581), which is the infinite sequence, the **n**'th term (0-indexing) is given by the closed form formula **6 × n2** .
Your task is to write code, which outputs all the subsets of the set of N first numbers in the sequence, such that the sum of the s... |
[Question]
[
Imagine you have two lights. These lights blink on and off at a specific rate:
```
Light 0: Delay 0ms and then blink every 1000ms
Light 1: Delay 500ms and then blink every 1000ms
```
Let's simulate these lights for the first 2000ms:
```
0ms: Light 0 on
500ms: Light 1 on
1000ms: Light 0 off
1500ms: ... |
[Question]
[
Given a number n, print the nth **prime** Fermat number, where the Fermat numbers are of the form 22k+1. This code should theoretically work for any n (i.e. don't hardcode it), although it is not expected to terminate for n > 4. (It should **not** return 4294967297 for n=5, as 4294967297 is not a prime... |
[Question]
[
## Challenge
Given a list of SI base units, a list of equations and a target, you must derive the units of the target using only the base units.
## Derived Units
*From Wikipedia:*
>
> The International System of Units (SI) specifies a set of seven base units from which all other SI units of measuremen... |
[Question]
[
# Today, we'll be generating a map for a roguelike RPG!
## Example Map:
```
##########
#### F#
#### ##
## C#C#
# ## #
# C #E #
#### # #
# #
#P #
##########
```
`#` are walls, `P` is the player's starting location, `F` is the finish that must be reached, `C` are coins that ... |
[Question]
[
The objective is to produce output of n squares (nxn) of random integers (`0-9`) with a moving `*` that rotates clockwise around the corners, starting from the top left. The squares should be side by side and separated by a single space.
If `n = 0`, the output should be empty.
Output for `n=1`:
`*`
Out... |
[Question]
[
It's weekend and what are the cool guys doing on weekends? Drinking of course! But you know what's not so cool? Drinking **and** driving. So you decide to write a program that tells you how loaded you are and when you are gonna be able to drive again without getting pulled over by the cops and loosing ... |
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.