text stringlengths 180 608k |
|---|
[Question]
[
In this challenge you are going to place letters from the alphabet in a Cartesian plane and output the result as a text.
Your input will consist in a list of list with 3 parameters:
* X coordinate
* Y coordinate
* String
**How?**
We know that a Cartesian plane contain 2 axes \$(X, Y)\$ and 4 quadrants... |
[Question]
[
# How the encoding works
Given a list of bits:
* Hold a prime (starting with `2`)
* Have a list
* For each bit in the input
+ If it's the same as the previous bit, add the prime you're holding to the list
+ If it's different, hold the next prime and add that to the list
* Return the product of all th... |
[Question]
[
**This question already has answers here**:
[Cantor's unspeakable numbers](/questions/101231/cantors-unspeakable-numbers)
(26 answers)
Closed 6 years ago.
This challenge is based on a drinking game. I advise against alcohol consumption while programming.
In this game, the players count up in tur... |
[Question]
[
# Task
You will be given a string in the input consisting only of the characters from `a` to `z`, i.e. the input will match the regex `/^[a-z]*$/`.
Your output should be a complete program in the same language, whose source code contains the input, and is a proper quine.
# Example
Your program would re... |
[Question]
[
# Introduction
We've have a few base conversion challenges here in the past, but not many designed to tackle arbitrary length numbers (that is to say, numbers that are long enough that they overflow the integer datatype), and of those, most felt a little complicated. I'm curious how golfed down a chang... |
[Question]
[
Write a program or function that takes in an odd positive integer N and a string of decimal digits (`0123456789`). The string represents a ten-state [one-dimensional cellular automaton](http://mathworld.wolfram.com/ElementaryCellularAutomaton.html). Each digit occupies one cell and the update rule from... |
[Question]
[
Given a space-separated list of integers, your task is to find the next integer in the sequence.
Each integer in the sequence is the result of applying a single mathematical operation(`+`,`-`,`*` or `/`) to the previous integer, and each sequence is made up of a variable number of such operations (but ... |
[Question]
[
The question score on Stack Exchange is the total number of upvotes minus the total number of downvotes a question receives. However, the reputation gained/lost for every upvote/downvote is different (eg. 10/-2 on Code Golf).
Given the total reputation earned, the reputation gained by an upvote and the... |
[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.
---
Christmas is coming up, and Santa hasn't kept to his diet very well this year. Due to ... |
[Question]
[
Given two integer matrices `a` and `b`, your challenge is to replace any occurences of `b` in `a` with a matrix of the same size filled with 0s. For example:
```
Given:
a: [ [1, 2, 3],
[4, 3, 2],
[3, 5, 4] ]
b: [ [3],
[2] ]
b occurs once in a:
[ [1, 2, **3**],
[4, 3, **2**],
[3, 5, 4... |
[Question]
[
According to [Wikipedia](https://en.wikipedia.org/wiki/Blum_integer),
>
> In mathematics, a natural number \$n\$ is a Blum integer if \$n = p \times q\$ is a semiprime for which \$p\$ and \$q\$ are distinct prime numbers congruent to \$3 \bmod 4\$. That is, \$p\$ and \$q\$ must be of the form \$4t + 3... |
[Question]
[
Wow, time really flies! It's already been one year since the [debut of the Code Golf Stack Exchange site design](https://codegolf.meta.stackexchange.com/questions/17760/congratulations-your-site-design-is-now-live). Let's celebrate this milestone with a code golf challenge... to imitate the site logo!
... |
[Question]
[
## Task
Given 2 positive integers `n` and `k`, where `n > k`, output the number of surjections from a set of `n` distinguishable elements to a set of `k` distinguishable elements.
## Definition
A function f: S → T is called a surjection if for every t∈T there is s∈S such that f(s) = t.
## Example
When ... |
[Question]
[
Given a non-negative integer or a list of digits, determine in how many ways can the number be formed by concatenating square numbers, which may have leading zeroes.
# Examples
```
input -> output # explanation
164 -> 2 # [16, 4], [1, 64]
101 -> 2 # [1, 01], [1, 0, 1]
100 -> 3 # [100], [1, 00], [1, 0, ... |
[Question]
[
# Overview
Given a list of digits, find the fewest operations to make 100
# Input
A string of digits, which may or may not be in numerical order. The order of the digits cannot be changed, however plus (+) or minus (-) operators may be added between each so that the total sum is equal to 100.
# Output
... |
[Question]
[
Given one of the following as input:
```
AK,AR,AS,AZ,CA,CT,DC,FL,GA,IL,IN,IA,KS,KY,LA,MD,MI,MN,MS,NV,NH,NJ,NM,NY,NC,ND,MP,OH,OK,OR,PA,PR,RI,SC,TN,TX,UT,VT,VA,WA,WI
```
(with quotes)
```
"AK","AR","AS","AZ","CA","CT","DC","FL","GA","IL","IN","IA","KS","KY","LA","MD","MI","MN","MS","NV","NH","NJ","NM","N... |
[Question]
[
If you don't know what a queen is in chess, it doesn't matter much; it's just a name :)
Your input will be a *square* of arbitrary width and height containing some amount of queens. The input board will look like this (this board has a width and height of 8):
```
...Q....
......Q.
..Q.....
.......Q
.Q.... |
[Question]
[
Your challenge is to write a program or function that hiccups a string. It should take a string as input (via any standard method), then follow these steps:
1. Generate a (not necessarily uniformly) random integer **n** between 1 and 10, inclusive.
2. Wait **n** seconds.
3. Print the initial/next **n**... |
[Question]
[
# Challenge description
Let's start with some definitions:
* a **relation** is a set of ordered pairs of elements (in this challenge, we'll be using integers)
For instance, `[(1, 2), (5, 1), (-9, 12), (0, 0), (3, 2)]` is a relation.
* a relation is called **transitive** if for any two pairs of elements... |
[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 1 year ago.
... |
[Question]
[
Part of [**Advent of Code Golf 2021**](https://codegolf.meta.stackexchange.com/q/24068/78410) event. See the linked meta post for details.
The story continues from [AoC2015 Day 24](https://adventofcode.com/2015/day/24), Part 2.
*[Here's why I'm posting instead of Bubbler](https://chat.stackexchange.com... |
[Question]
[
Related: [Is this quadrilateral cyclic?](https://codegolf.stackexchange.com/q/176162/78410)
## Background
A [tangential quadrilateral](http://mathworld.wolfram.com/TangentialQuadrilateral.html) is a quadrilateral which has an incircle:

Examples include any squar... |
[Question]
[
## Introduction:
*I have loads of different ciphers stored in a document I once compiled as a kid, I picked a few of the ones I thought were best suitable for challenges (not too trivial, and not too hard) and transformed them into challenges. Most of them are still in the sandbox, and I'm not sure yet... |
[Question]
[
Given a non-negative integer Excel-style date code, return the corresponding "date" in any reasonable form that clearly shows year, month, and "day".
Trivial, you may think. Did you notice the "scare quotes"? I used those because Excel has some quirks. Excel counts days with number 1 for January 1st, 1... |
[Question]
[
Write a code that runs or compiles in as many programming languages as possible and prints a newline separated list of names of previous and current programming languages.
* Every used language must have 1 character longer name than previous; ex. `C#`, `C++`, `Ruby`, `Jelly`, `Python`...
* Each languag... |
[Question]
[
Given a key, and an array of strings, shuffle the array so that it is sorted when each element is XOR'd with the key.
## XOR'ing two strings
To XOR a string by a key, XOR each of the character values of the string by its pair in the key, assuming that the key repeats forever. For example, `abcde^123` l... |
[Question]
[
In this [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") challenge, you must output an ascii-art of a random die roll.
like this:
```
________
/\ \
/ \ 6 \
{ 4 }-------}
\ / 5 /
\/_______/
```
Please note that:
```
________
/\ \
/ \ 3... |
[Question]
[
Ulam's spiral is a *truly* fascinating, yet puzzling, topic in mathematics. How it works in detail can be found [here](https://en.wikipedia.org/wiki/Ulam_spiral), but a short summary can be explained as so:
I start off by writing a one, then I write a two to the right of it. Above the two, I write a th... |
[Question]
[
What general tips do you have for golfing in [INTERCAL](https://en.wikipedia.org/wiki/INTERCAL)? I'm looking for ideas which can be applied to code golf challenges and are also at least somewhat specific to INTERCAL (i.e. "remove comments" is not a useful answer).
I know exotic languages can be really ... |
[Question]
[
For a given positive integer `n`, consider all binary strings of length `2n-1`. For a given string `S`, let `L` be an array of length `n` which contains the count of the number of `1`s in each substring of length `n` of `S`. For example, if `n=3` and `S = 01010` then `L=[1,2,1]`. We call `L` the counti... |
[Question]
[
Your friend isn't too good with computers so as a practical joke someone scrambled the letters (a-z) on his keyboard. When he sit down and tried to type his name looking at the keyboard he realized that the letters are scrambled and asked your help.
You are smart so you know that if he types his name a... |
[Question]
[
Your job is to convert decimals back into the sum of the square roots of integers. The result has to have an accuracy of at least 6 significant decimal digits.
**Input**:
A number indicating the number of square roots and a decimal indicating the number to approximate.
Example input:
```
2 3.4142135623... |
[Question]
[
Tallying is a simple counting system that works in base 5. There are various different tallying systems used around the world, but the one that is used in most English-speaking countries is perhaps the most simple - count units by marking vertical lines, then for each 5th mark put a horizontal line thr... |
[Question]
[
From the infinite triangular array of positive integers, suppose we repeatedly select all numbers at Euclidean distance of \$\sqrt{3}\$, starting from 1:
$$
\underline{1} \\
\;2\; \quad \;3\; \\
\;4\; \quad \;\underline{5}\; \quad \;6\; \\
\;\underline{7}\; \quad \;8\; \quad \;9\; \quad \underline{10} ... |
[Question]
[
You want to see how quickly the ratio of two consecutive Fibonacci numbers converges on φ.
Phi, known by the nickname "the golden ratio" and written as \$φ\$, is an irrational number, almost as popular as π and e. The exact value of \$φ\$ is \$\frac {1 + \sqrt 5} 2 = 1.618...\$
The Fibonacci sequence i... |
[Question]
[
[Sandbox](https://codegolf.meta.stackexchange.com/a/19094/82007)
Many of us have seen math problems where a shape made of unit cubes is dipped in paint, and the answer is the number of painted sides. We'll generalize that problem in this challenge.
# Input
A 3-dimensional matrix of 0s and 1s.
# Output
... |
[Question]
[
Given integer `n`, output the smallest exponent `e` greater than 1 such that `n^e` contains `n` as a substring.
For example, for `25`, the answer should be `2`, as `25 ^ 2 = 625`, which contains `25` as a substring, but the answer for `13` should be `10`, as `13 ^ 10 = 137858491849`, so `10` is the low... |
[Question]
[
## Definitions
The **kth** ring of a square matrix of size **N**, where **1 ≤ k ≤ ceiling(N/2)** is the list formed by the elements of the **kth** and **(N-k+1)th** rows and columns, but without the first and last **k-1** elements.
Example:
```
Matrix:
1 2 3 4 5
6 7 8 9 1
8 7 6 5 4
3 2 1 9 8
7 6 5 4 3
... |
[Question]
[
You are trying to fit a sphere into a 5-sided box, but sometimes it does not fit completely. Write a function to calculate how much of the sphere is outside (above the rim of) the box.
There are 3 possible situations:
* The sphere fits completely in the box. The answer will be 0.
* The sphere sits on t... |
[Question]
[
Since Fibonacci numbers and sequences seems like a popular subject for code golf I thought that it might be a fun challenge to code golf with [Keith numbers](http://en.wikipedia.org/wiki/Keith_number).
So I propose a challenge that is to create a function that takes an integer and gives back a true or ... |
[Question]
[
Write a [Turing machine](https://en.wikipedia.org/wiki/Turing_machine) simulator.
For simplicity we can assume statuses as integer, symbols as char, blank symbol equals whitespace
5-tuple in the form of current state, input symbol, next state, output symbol, direction (left or right) the order is not m... |
[Question]
[
If \$R\$ runners were to run a race, in how many orders could they finish such that exactly \$T\$ runners tie?
### Challenge
Given a positive integer \$R\$ and a non-negative integer \$0\leq T\leq {R}\$ produce the number of possible finishing orders of a race with \$R\$ runners of which \$T\$ tied.
No... |
[Question]
[
“Cut” a matrix of integers on the line where the sum of the absolute differences of “severed” neighbors is the least.
## Example
Consider this matrix:
```
1 2 -4
5 -1 3
2 -2 0
```
It can be cut in 4 places, here shown by lines lettered `A`–`D`:
```
A B
╷ ╷
1 ╎ 2 ╎ -4
C ---╎---... |
[Question]
[
Gobar primes ([A347476](https://oeis.org/A347476)) are numbers which give a prime number when 0's and 1's are interchanged in their binary representation.
For example, \$10 = 1010\_2\$, and if we flip the bits, we get \$0101\_2 = 5\$ which is prime. Therefore, 10 is a Gobar prime
As simple as that: pri... |
[Question]
[
## Background
**Polyagony** is a family of hypothetical esolangs where the source code is laid out on a specifically shaped board before running it. It's similar to Hexagony, but various [uniform tilings](https://en.wikipedia.org/wiki/Euclidean_tilings_by_convex_regular_polygons#Archimedean,_uniform_or... |
[Question]
[
Inspired by [this 3Blue1Brown video](https://www.youtube.com/watch?v=O85OWBJ2ayo)
Given a square matrix \$ M \$, compute its [matrix exponential](https://en.wikipedia.org/wiki/Matrix_exponential) \$ \exp(M) \$, which is defined, using an extension of the [Maclaurin series for \$ e^x \$](https://en.wiki... |
[Question]
[
Suppose denominations of banknotes follow the infinity [Hyperinflation sequence](https://codegolf.stackexchange.com/q/210671/44718): \$ $1, $2, $5, $10, $20, $50, $100, $200, $500, $1000, $2000, $5000, \cdots \$. How many banknotes are required, at minimum, to pay a \$$n\$ bill?
Consider Alice needs to... |
[Question]
[
A ripoff of [this challenge](https://codegolf.stackexchange.com/q/207404/89459). Go upvote it!
# Objective
Given a rational number amongst \$[0,1]\$, apply the [Cantor function](https://en.wikipedia.org/wiki/Cantor_function) to it and output the rational number that's produced.
# The Cantor function
Th... |
[Question]
[
Today's challenge:
>
> Given an ordered list of at least 3 *unique* integer 2D points forming a polygon, determine if the resulting polygon is [Rectilinear](https://en.wikipedia.org/wiki/Rectilinear_polygon).
>
>
>
A polygon is rectilinear if every interior angle is a right angle. The edges do not ... |
[Question]
[
Display the emoji of the eastern zodiac of given time, according to given country.
The eastern zodiac is a classification scheme that assigns an animal and its reputed attributes to each year in a repeating 12-year cycle. It is also assigned to hours.
**Rules:**
1. The country must be given as ISO 3166... |
[Question]
[
*Inspired by [last week's APL lesson](https://chat.stackexchange.com/rooms/52405/conversation/lesson-27-lookup-without-replacement "Lesson 27 - lookup without replacement").*
Given an uppercase 2D seat map and a 1D list of customers, return the seat map and the customer list but modified as follows (to... |
[Question]
[
Suppose you have two six-sided dice. Roll the pair 100 times, calculating the sum of each pair. Print out the number of times each sum occurred.
If a sum was never rolled, you must include a zero or some way to identify that that particular sum was never rolled.
Example Output:
[3, 3, 9, 11, 15, 15, 1... |
[Question]
[
Print a tower block with the shortest possible code.
**Input:**
The input defines how many floors the tower block has. One floor contains a window on either side of the door. The window is made up of 3x3 hashes.
An example of a 4 storey tower block is below:
```
=====================
)V V ... |
[Question]
[
# Background
You are working as a programmer for a car sales company.
Your task for this week is to program an XML parser that takes in data about available models from different car manufacturers, and pretty-prints information about the newest models.
Luckily for you, the testing department has provid... |
[Question]
[
I downloaded POV-ray and rendered this shiny metal sphere 90s style:

Your task is to do the same thing, but to do it by implementing the rendering engine yourself in as few bytes as possible. You don't have to replicate this exact ima... |
[Question]
[
Given the following C# program outputting `False`, inject a 'malicious' line of code such that the program outputs `True`.
```
class Program
{
static void Main()
{
System.Console.Write("False");
;
}
}
```
Your answer should consist of a string that replaces the second semico... |
[Question]
[
Write a function which takes a date and returns the day of the week of the next February 29th after that date.
* The input is a string in the ISO Extended format: YYYY-MM-DD (e.g. May 27th, 2010 would be "2010-05-27").
* The output is a string which is the name of the day of the week (e.g. "Monday"). C... |
[Question]
[
# Background
A number `n` can be described as `B`-rough if all of the prime factors of `n` strictly exceed `B`.
# The Challenge
Given two positive integers `B` and `k`, output the first `k` `B`-rough numbers.
# Examples
Let `f(B, k)` be a function which returns the set containing the first `k` `B`-roug... |
[Question]
[
Your task is to accept as input two gene sequences, and a sequence of "cross over points", and return the gene sequence that results from the indicated cross overs.
What I mean by this is, say you have the sequences `[A, A, A, A, A, A, A]` and `[Z, Z, Z, Z, Z, Z, Z]`, and cross over points of `2` and `... |
[Question]
[
*This is a [cops-and-robbers](/questions/tagged/cops-and-robbers "show questions tagged 'cops-and-robbers'") challenge. For the cops thread, go [here](https://codegolf.stackexchange.com/q/109949/42963).*
This challenge involves two [OEIS](https://oeis.org/) sequences chosen by the cops -- **S1**, **S2*... |
[Question]
[
Take a non-nested array as input. Turn it into a matrix by using the following method:
Let's say my array is `[1, 2, 3, 4, 5]`
First, I repeat that array 5 times: (the length)
```
[[1, 2, 3, 4, 5],
[1, 2, 3, 4, 5],
[1, 2, 3, 4, 5],
[1, 2, 3, 4, 5],
[1, 2, 3, 4, 5]]
```
Then, I read it along the dia... |
[Question]
[
The challenge is: generate an audio file made of white noise.
Requirements and instructions:
* Your program must generate an audio file containing only white noise, meaning its intensity is the same for all (reasonable) frequencies and nonzero [see an example [plot](http://en.wikipedia.org/wiki/File%... |
[Question]
[
**What is Typoglycemia?**
Typoglycemia is a term that refers to the phenomenon where readers are able to understand text even when the letters in the middle of words are jumbled, as long as the first and last letters of each word remain in their correct positions. For example,
>
> Aoccdrnig to a rsche... |
[Question]
[
# Task
Given a list of nodes representing a binary tree of positive integers serialized depth-first, return a list of nodes representing the same tree serialized breadth-first. To represent an absent child, you may use `null`, `0`, `'X'`, `Nothing`, `[]`, or any other value that is distinct from your r... |
[Question]
[
I've tried this question on two forums and have been told this is the best place for this type of question. I'm trying to print from 0 to 1000 then back to 0 again (and all numbers in-between), printing 1000 only once. Also, each number must be on a separate line using vanilla PHP.
My current code is 6... |
[Question]
[
A great Python golfing tip is to [omit needless spaces](https://codegolf.stackexchange.com/a/87181/88546). But if you are like me, you don't always have the time to search for which spaces to remove. If only there was a way to speed up the process...
## Task
Given a *single line* of Python, as input, r... |
[Question]
[
### Task
Given an array of non-negative numbers, output the largest and smallest possible number that can be formed by joining them.
### Rules
Input,Output can be in any convenient format.
The array may have at most 1 decimal number.
### Examples
```
input:[22,33,44,55.55,33]
output:4433332255.55,55.55... |
[Question]
[
You are fish in a pond that needs to survive by eating other fish. You can only eat fish that are the same size or smaller than yourself. You must create a program that takes a shoal of fish as sorted input. From this you must work out how many fish you can eat and ultimately the size you will grow to.... |
[Question]
[
We all know that a lot of exercises only affect one half of your body, so you have to do them twice, once for each side. Such exercises have two counterparts, one for the left side and one for the right. However, there's no need to execute the two counterparts consecutively, as long as the exercises fo... |
[Question]
[
## Prologue
After installing an anti-XSS browser extension, Stack Snippets suddenly stopped working all across the Stack Exchange network. I could no longer learn from [Stack Overflow](//stackoverflow.com), see working demos on [User Experience](//ux.stackexchange.com) and, worst of all, could not test... |
[Question]
[
Given a list of integers `L`, and an integer `N`, output `L` splitted in `N` sublists of equal lenghts.
### Non-divisible lengths
If `N` does not divide the length of `L`, then it is not possible that all sublists have equal length.
In any case, the last sublist of the output is the one that adapts its... |
[Question]
[
### Introduction
For the ones who never heard of this game before. You are playing a ball which needs to survive as long as possible. This is done by moving to the left or right, going to the holes. Since the map moves upwards, you need to go downwards to survive longer. If you [search](https://www.goo... |
[Question]
[
**Input:**
Input is a randomized array of nuts (in your language), the possible nuts follow. Your program must have a way of representing each kind of nut, such as an integer code. Program must be able to handle any size array of any configuration of nuts.
**Possible Nuts:**
```
Kola nut
Macadamia
Mamo... |
[Question]
[
Given integers `k` and `n`, generate a sequence of `n` unique *k-tuples* of pairwise coprime integers. *Every* such tuple must occur once eventually, that is, for any existing k-tuple of pairwise coprime integers, some `n` will eventually generate it.
The output may be printed or evaluated in any list/... |
[Question]
[
For robbers' post, [Cheapo Enigma machine (Robbers)](https://codegolf.stackexchange.com/questions/117319/cheapo-enigma-machine-robbers)
A cop's submission will consist of a program/function that accepts a single byte of data and return a single byte of data. Every possible input must produce a unique o... |
[Question]
[
Given a [semiprime](https://en.wikipedia.org/wiki/Semiprime) **N**, find the smallest positive integer **m** such that the binary representation of one of the two factors of **N** can be found in the binary representation of **N \* m**.
### Example
Let's consider the semiprime **N** = **9799**.
We try ... |
[Question]
[
Given an input of a string representing a function definition, output the
string with newlines and spaces inserted so that the function's arguments are
newline-separated and aligned.
The input string will follow the following pattern:
* First, it will start with a prefix, which is always at least one c... |
[Question]
[
**The task** is to draw a regular polygon of n sides using only a compass and an unmarked ruler.
**Input** (n) is one of the following 10 numbers: 3, 4, 5, 6, 8, 10, 12, 15, 16, 17.
**Method**: Because you only have a ruler and compass you can only draw points, lines and circles.
A line can only be dra... |
[Question]
[
[OEIS A090461](https://oeis.org/A090461) details the ‘numbers k for which there exists a permutation of the numbers 1 to k such that the sum of adjacent numbers is a square’. This has also been the subject of [Matt Parker’s Numberphile](https://youtu.be/G1m7goLCJDY?si=jHHwz-yRH6N26SeK) and [Alex Bellos... |
[Question]
[
Take the sequence of all natural numbers in binary, `(1, 10, 11, ..)` then write them vertically beside each-other like this (least significant bit on top; 0s have been replaced with spaces):
```
1 1 1 1 1 1 1 1 1
11 11 11 11
1111 1111
11111111
11
```
Notice there are ar... |
[Question]
[
Given a multi-dimensional rectangular array of non-negative integers, pad it with the minimal number of zeroes so that only zeroes are "touching the edges" of the array, in every dimension.
The output must remain rectangular, have the same number of dimensions as the input, and be no smaller than the i... |
[Question]
[
Consider a positive integer `N` written in base `b`. A sequence is generated from this number by finding the largest digit `d` in the expansion of `N` and writing `N` in base `d+1`, repeating until the base the number is written in can be decreased no further. For example, the sequence generated by `34... |
[Question]
[
Gringotts isn't just a vault, but a reputable financial institution and wizards need loans too. Since you don't want to be screwed over by the Gringotts goblins, you decided it would be a good idea to write a program to calculate interest. Interest is compounded only yearly.
Your task is to calculate t... |
[Question]
[
[pylint](https://www.pylint.org/) has no lower bound on the scores it will give your code. It uses the following metric to score code, with the maximum score being 10:
```
10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
```
With python 3.6, try and write a program that:
*... |
[Question]
[
Back in the day, telephone autodialers used punched cards with one column for each digit of the number to be dialed. Columns had seven rows. The first three rows represented the numbers (1,2,3), (4,5,6), and (7,8,9) respectively. The last three rows rotated this arrangement by 90°: (1,4,7), (2,5,8), an... |
[Question]
[
## The Challenge
Your program should take 3 inputs:
* A positive integer which is the number of variables,
* A set of unordered pairs of nonnegative integers, where each pair represents an equality between variables, and
* A positive integer which represents the starting variable,
It should return a se... |
[Question]
[
Given an integer **n**, decompose it into a sum of maximal triangular numbers (where **Tm** represents the **m**th triangular number, or the sum of the integers from 1 to **m**) as follows:
* while **n > 0**,
+ find the largest possible triangular number **Tm** such that **Tm ≤ n**.
+ append **m** to... |
[Question]
[
*This is my first codegolf question, so I apologize in advance if it's not appropriate, and I welcome any feedback.*
I have a file with this format:
```
a | rest of first line
b | rest of second line
b | rest of third line
c | rest of fourth line
d | rest of fifth line
d | rest of sixth line
```
The a... |
[Question]
[
*Squaring the Square* is a process of tiling a square using only other squares. If this tiling only uses squares of different sizes, then it is considered to be *perfect*. The [smallest possible perfect squared square](https://en.wikipedia.org/wiki/Squaring_the_square) is a 112x112 square tiled using 2... |
[Question]
[
Write a named function or program that computes the quaternion product of two quaternions. Use as few bytes as possible.
## Quaternions
[Quaternions](http://en.wikipedia.org/wiki/Quaternion) are an extension of the real numbers that further extends the complex numbers. Rather than a single imaginary un... |
[Question]
[
Implement a function of pattern and string to be matched, return true if the pattern matches the WHOLE string, otherwise false.
Our glob pattern syntax is:
* `?` matches any one character
* `+` matches one or more characters
* `*` matches zero or more characters
* `\` escapes
Rules:
* No eval, no conve... |
[Question]
[
Given a positive number \$n\$, find the number of [alkanes](https://en.wikipedia.org/wiki/Alkane) with \$n\$ carbon atoms, ignoring [stereoisomers](https://en.wikipedia.org/wiki/Stereoisomerism); or equivalently, the number of unlabeled trees with \$n\$ nodes, such that every node has degree \$\le 4\$.... |
[Question]
[
## Summary
Implement FizzBuzz in Python, with the fewest possible tokens.
## Challenge
Write a program that prints the decimal numbers from 1 to 100 inclusive. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of bo... |
[Question]
[
## Introduction
In this challenge, you are given a list of nonnegative floating point numbers drawn independently from some probability distribution.
Your task is to infer that distribution from the numbers.
To make the challenge feasible, you only have five distributions to choose from.
* `U`, the [un... |
[Question]
[
This is a sequel to this challenge: [Code close to the challenge: Sum of integers](https://codegolf.stackexchange.com/questions/53604/code-close-to-the-challenge-sum-of-integers)
The challenge in this one is a bit harder, and also makes for a cool title (Which is why I picked it):
>
> Calculate the Le... |
[Question]
[
You should write a program or function that given an `N` by `N` equally spaced square grid and a solid inscribed circle outputs or returns the number of grid squares which are overlapped partially or fully by the solid circle.
0-sized overlaps (i.e. when the circle only touches a line) are not counted.... |
[Question]
[
Inspired by [Help me pair my socks](https://codegolf.stackexchange.com/q/196198/78410), and the fact that I have some pairs of socks where the left sock is distinct from the right.
---
## Background
Again, I have a huge pile of socks. And a machine that can give the list of labels of the socks for me. ... |
[Question]
[
*(based on [this](https://codegolf.stackexchange.com/q/194750/42963) deleted question)*
Take the English alphabet `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` (spaces added for clarity), and split it into chunks of `X` width, padding any leftover lines with spaces if necessary for your languag... |
[Question]
[
[Lenguage](https://esolangs.org/wiki/Lenguage) is a brainfuck dialect that is notorious for breaking source restriction challenges. That is because Lenguage cares only about the length of it's source and not the contents.
First, the length of the program is calculated. Then, said length is converted to... |
[Question]
[
## Background
A [fractal sequence](https://en.wikipedia.org/wiki/Fractal_sequence) is an integer sequences where you can remove the first occurrence of every integer and end up with the same sequence as before.
A very simple such sequence is called [Kimberling's paraphrases](https://oeis.org/A003602). ... |
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.