text stringlengths 180 608k |
|---|
[Question]
[
Given a Black Box function `ff` that takes a single floating-point parameter, write a function `M` to generate the [Maclaurin series](http://en.wikipedia.org/wiki/Taylor_series) for that function, according to the following specifications:
* take a parameter `n`, and generate all terms from `x^0` to ... |
[Question]
[
The inverse of [this question](https://codegolf.stackexchange.com/questions/232957/enlarge-ascii-art-mark-ii?noredirect=1&lq=1).
Your challenge is to, given a piece of ASCII art generated by the above question and its enlargement factor, shrink it down to its original size.
## The enlargement process... |
[Question]
[
## Background
[**A338268**](https://oeis.org/A338268) is a sequence related to [a challenge by Peter Kagey](https://codegolf.stackexchange.com/q/213848/78410). It defines a two-parameter function \$T(n,k)\$, which counts the number of integer sequences \$b\_1, \cdots, b\_t\$ where \$b\_1 + \cdots + b... |
[Question]
[
The [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) between two strings is the minimum number of single character insertions, deletions, or substitutions to convert one string into the other one. Given a binary string \$S\$ of length \$n\$, we are a interested in the number... |
[Question]
[
**This question already has answers here**:
[Fibonacci function or sequence](/questions/85/fibonacci-function-or-sequence)
(334 answers)
Closed 6 years ago.
# Background
We all know the famous [Fibonacci sequence](https://oeis.org/A000045), where each term is the sum of the previous two, with ... |
[Question]
[
You sell gold coins. Each gold coin you sell is supposed to be 1 ounce. However, you find out that one of your coin suppliers is cheating you. By alloying the gold material with something else, their coins weigh only 0.9 ounces. With a help of a **pointer** scale (one that shows the exact weight of a... |
[Question]
[
I have this code :
```
tr ' ' '\n'|sort -n|head -1
```
The code is pretty simple, it takes a list of integer in the standard input stream (like `5 9 8 7 5 2 -12 -30`), it sort the integers and display only the first integer. But i need to ouput `0` if the given list is empty. And i can't find a short... |
[Question]
[
The [Walsh matrix](http://en.wikipedia.org/wiki/Walsh_matrix) is an interesting fractal matrix with the property that every single value in a Walsh matrix has a value of either -1 or 1. Additionally, the size of a Walsh matrix is always a power of 2.
Because each Walsh matrix is identical to the top-... |
[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/869/edit).
Closed 7 years ago.
[Improve this question](/posts/869/edit)
Wr... |
[Question]
[
Write a program that takes a United States aircraft registration number and returns a 24-bit ICAO hex code corresponding to that registration and vice-versa.
An aircraft registration number always begins with an N and is followed by 1 to 5 characters: 1 to 5 digits and then 0 to 2 uppercase letters. ... |
[Question]
[
# Input
Two non-negative floating point numbers \$x < y\$. You can assume they are close enough to each other that there is no integer between \$x\$ and \$y\$.
# Output
A fraction with the smallest possible denomination that lies strictly between \$x\$ and \$y\$.
# Examples
Input: 1 and 2
Output: 3/2... |
[Question]
[
Consider an \$n \times n\$ grid and a circle of radius \$r \leq \sqrt{2} n\$ with its center in the top left. In each square there is an integer from the range -3 to 3, inclusive. For a given radius, there is a set of squares in the grid which are not at least half covered by a circle of radius \$r\$... |
[Question]
[
If you wanted to compute a very large long problem, that on a machine that you could buy today for an inflation adjusted price, will take some amount of years/decades. The issue is, if you only have that budget, and so can only purchase one machine. So if you purchase the machine now, it may actually... |
[Question]
[
* Task:
With the minimum amount of bytes, determine today's Zodiac sign using the programming language of your choice.
* Rules:
This is code golf, the answer with the fewest characters wins. The initialization of getting the current date into a variable (e.g. `var now = new Date();`) does not add... |
[Question]
[
Given the measures of two of the interior angles of a triangle (`x` and `y`; the other angle can be easily calculated with `180 - x - y`), draw a line segment that cuts this triangle into two isosceles triangles. You need to output the angle measures of both of your triangles.
However, because the ba... |
[Question]
[
I have some JavaScript code in a `<script>` HTML tag I'd like to golf, while still remaining in the tag. How can I golf that code, if at all? Here's the code:
```
<script>document.write`<font color=#40e0d0 face=arial>YOU ARE IN THE BEDROOM.<br>YOU SEE CRAB NICHOLSON.<br>HE HAS NO MITT... |
[Question]
[
Sometimes lexicographical sorting of strings may cut it, but when browsing the filesystem, you really need better sorting criteria than just ASCII indices all the time.
For this challenge, given a list of strings representing filenames and folders in a directory, do a filesystem sort, explained below... |
[Question]
[
Count the number of contiguous blocks within a given 3D input.
## Input
The input will consist of one or more rectangles of characters separated by blank lines. Each rectangle represents a cross section of the 3D space. The characters used will be `0`, representing empty space, and `1` representing a... |
[Question]
[
Given some code in your language as a string, find and display all the variable names.
Examples in pseudocode:
```
a=2
b=3
for(i, 0->9) do b=b-10
if a=b then write "a equals b"
```
Returns: `a b i`
```
abcdefgh=20000000000000
bcdifhgs="hello"
if abcdefgh=bcdifhgs then da44="hax"
if abcdefgh*2=da44 th... |
[Question]
[
There is a mouse in a room, in the top-left corner. It can move up, down, left, or right, and the mouse cannot go through any cell in the room twice. Given this, return all the possible paths in which the mouse will visit every square.
**Input:** Two integers `m` and `n`, which represent the `m x n`... |
[Question]
[
I have the code:
```
marks = tuple(tuple((input("Enter subject: "), input("Enter marks: "))) for _ in range(int(input("Enter number of tuples: "))))
print(tuple((s[:3].upper(), max(int(m) for t, m in marks if t == s)) for s in set(t for t, m in marks)))
```
```
#INPUT
(("Physics",131),("Chemistry",30... |
[Question]
[
In this game, you can look inside one box at a time chosen by you. When you do that, you can see how many coins there are in that box.
The wizard has one last twist for you. At any point, you can choose to give up on this set of boxes and get him to start the whole process again (with a new random \$... |
[Question]
[
Mahjong is a tabletop game played using tiles. It features three "number" suits (pins, sous, mans, represented as `p`, `s` and `m`) from 1 to 9, and one "honor" suit `z` of seven distinct tiles. Note that contrary to western card games, tiles are not unique.
[![https://user-images.githubusercontent.c... |
[Question]
[
I was wondering if there is any way to assign 2 values (G and H) to say a list of ["egg", "chicken"] in Pyth. In python it would be something along the lines of
```
G, H = ["egg", "chicken"]
```
At the moment the shortest way I can think of would be something like
```
=N["egg""chicken")=G@N0=H@N1
```... |
[Question]
[
**This question already has answers here**:
[Stackable sequences](/questions/144201/stackable-sequences)
(27 answers)
Closed 2 years ago.
Related: [What's my telephone number?](https://codegolf.stackexchange.com/q/198237) which asks to calculate the terms of [A000085](https://oeis.org/A000085)... |
[Question]
[
This challenge is about [Haskell](https://en.wikipedia.org/wiki/Haskell_(programming_language)) [point-free style](https://en.wikipedia.org/wiki/Tacit_programming) polynomial functions.
Although you **don't** need to know Haskell language to do this challenge, Haskellers might have an advantage here.... |
[Question]
[
Amazingly, this is the easier of the three card tricks I know off the top of my head...
The aim of this is to have your compiler perform a specific card trick. There's no slight of hand, and the compiler won't be memorizing the choice and saying "Voila, this is your card!" The code will basically man... |
[Question]
[
# The Task
Build a function that takes a string of coins ending with an item index, and generates change as a string of coins using the least amount of coins possible.
The following are the items that can be bought (0-indexed):
`[0.45, 0.60, 0.75, 0.95, 1.10, 1.25, 1.40, 1.50, 1.75, 2.00]`
The follow... |
[Question]
[
The reverse of an *n*-bit number is just its *n* binary digits in reverse order:
>
> 001010010 → 010010100
>
>
>
Given a number *n*, generate all *n*-bit integers ([*0, 2n-1*]) in an arbitrary order, with only one restriction: there must be a splitting point such that the reverse of an integer is... |
[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/54556/edit).
Closed 8 years ago.
[Improve this question](/posts/54556/edit)... |
[Question]
[
This challenge is the second of a series of [fastest-code](/questions/tagged/fastest-code "show questions tagged 'fastest-code'") problems that should be written in the [GOLF CPU](http://meta.codegolf.stackexchange.com/questions/5134/the-golf-cpu-framework). You can find the first [here](https://code... |
[Question]
[
This isn't as much a "challenge" as "a unique problem that there are no built-in functions to solve." Basically, you need to do this:
* Read some lines of numbers from `stdin`. These lines may contain trailing or preceding whitespace, and there may be empty lines. No lines will contain "just whitespa... |
[Question]
[
You are from the tiny country of Que-Wopistan. The Que-Wopistonion's are a proud people, and every Que-Wopistonian dreams of making their country proud by representing their country in the Olympics.
You have been given the incredible honor of competing in the 100-meter-dash. You are the nations sole... |
[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/38567/edit).
Closed last year.
[Improve this question](/posts/38567/edit)
... |
[Question]
[
1. Your program should take no input, and no network or other connections.
2. Your program should output it's sourcecode.
3. The sourcecode must consist of **3 types** of characters: Numeric (0-9), Alpha (a-z|A-Z) and symbols !(0-9|a-z|A-Z). Constraints for the distribution of characters is:
* 3.1. ... |
[Question]
[
The [Champernowne constant](http://en.wikipedia.org/wiki/Champernowne_constant) is a transcendental decimal number whose digits are the concatination of all positive integers.
C10 = `0.12345678910111213141516...`10
The binary version of this is
C2 = `0.1101110010111011110001...`2
Write a program that... |
[Question]
[
With a twist; your algorithm has to be less complex than O(X2) where X is the Nth prime. Your solution post should include the character count and the theoretical complexity in terms of X (or N, which ~= X/ln(X) and so will usually be more efficient)
Here's a hint solution in C# (O(Xln(sqrt(X))), 137... |
[Question]
[
How much can you golf a program to print ["An Old Irish Blessing"](https://codegolf.stackexchange.com/questions/1682/an-old-irish-blessing) **without using unprintable ASCII characters**?
That restricts us to ASCII characters 32-126 (better still, 32,65-90,97-122 and 13(CR))
For reference that versio... |
[Question]
[
The [wizard](https://codegolf.stackexchange.com/questions/251029/optimal-strategy-to-defeat-the-wizard) has a cunning cousin who is a witch. She looks down on the wizard, regarding him and his puzzles as mathematically naive. On reading his latest puzzle, she scorned him for always asking discrete pr... |
[Question]
[
*Who's up for a second attempt?*
If you've ever listened to the radio program "I'm sorry, I haven't a clue", then you've probably heard of the game called "Mornington Crescent". For those who haven't, it's a game where players name random stations on the London Underground network. The first person t... |
[Question]
[
# The riddle
In yesterday's newspaper, I found a puzzle in which a Rook should start in the lower-left corner of a 12x12 checkerboard and then, during a round trip, visit each field exactly once except for a selection which must be avoided. The puzzle came with a picture that identified the fields to... |
[Question]
[
Any two separate nodes in a binary tree have a common ancestor, which is the root of a binary tree. The lowest common ancestor(LCA) is thus defined as the node that is **furthest from the root** and that is the ancestor of the two nodes.
The following are binary trees and the lowest common ancestors... |
[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 4 years ago.
[Improve this que... |
[Question]
[
## Challenge
Given a list of integers and a velocity, \$v\$, implement a sorting algorithm which simulates a program sorting the list from smallest to biggest at the given velocity.
## Einstein's Theory of Special Relativity
What do I mean? Well assume your program takes a time, \$T\$, to sort a part... |
[Question]
[
**Closed**. This question needs to be more [focused](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Update the question so it focuses on one problem only by [editing this post](/posts/143566/edit).
Closed 6 years ago.
[Improve this question]... |
[Question]
[
**This question already has answers here**:
[Output all strings](/questions/74273/output-all-strings)
(28 answers)
Closed 6 years ago.
**Description**
There are an infinite number of ASCII strings. Write a program that will output every possible ASCII string exactly once.
The ordering does not... |
[Question]
[
**This question already has answers here**:
[Find the number in the Champernowne constant](/questions/66878/find-the-number-in-the-champernowne-constant)
(29 answers)
Closed 6 years ago.
Inspired by [this question](https://codegolf.stackexchange.com/questions/91432/where-are-champernownes-zero... |
[Question]
[
Okay, so everyone is familiar with the [ASCII-table](http://www.asciitable.com/), correct? I'd hope so. I've been going to that site for my asciitable reference for as long as I can remember needing one. We'll be doing some fun source-code manipulating using the ASCII keyspace.
---
# The Task
Your ta... |
[Question]
[
Rules:
1. Your program can be in any programming language.
2. Your program should not take any input.
3. Your program should transform the word "RELATIVE" into "STATIC". The word can at any stage only consist of uppercase letters A-Z.
4. Your program can only use 8 different operations.
5. The length... |
[Question]
[
Slighty inspired by my previous challenge regarding [Keith Numbers](https://codegolf.stackexchange.com/questions/9319/test-if-given-number-if-a-keith-number/) I want to propose a challenge to create a function that takes an integer and gives back a true or false depending on the number is a Reverse K... |
[Question]
[
You can count 0, 1, 2, 3, 4.
But to get from 3 to 4 you have to change 3 bits at once.
Given a number of bits, how can you go through all numbers once,
but change at each step only 1! bit.
Here is an example for 3 bits:
```
000 100 110 010 011 111 101 001
```
so the output is:
```
0 1 3 2 6 7 5 4
```... |
[Question]
[
A [perfect power](https://en.wikipedia.org/wiki/Perfect_power) is a positive integer that's equal to one positive integer, to the power of another positive integer (e.g. *a**b* is a perfect power). Note that trivial solutions (e.g. *b*=1) are excluded; specifically, the definition requires *a* ≥ 2 an... |
[Question]
[
I could not think of a better title.
**This is a tips question. I'm asking for tips on golfing my code.**
I recently took part in a code golf competition in C. The competition ended and I lost. The problem is:
>
> Input a line with a number *n*.
>
>
> Then input *n* lines, each line contains only ... |
[Question]
[
**This question already has answers here**:
[Generate all combinations of given list of elements, sorted](/questions/102835/generate-all-combinations-of-given-list-of-elements-sorted)
(14 answers)
Closed 2 years ago.
Taking a positive integer `n` as input, print the sample space of `n` consecu... |
[Question]
[
Write a regex that only matches valid country code top level domains (ccTLDs). Your regex must match both the domains with the dot and without the dot (it must match tv and .tv). Any domain that is not a ccTLD or does not exist (e.g. .info or .jobs or .xz) must not be matched.
Use Perl, POSIX, PCRE o... |
[Question]
[
# Introduction
So my boss is making me do some [manual labor](https://en.wikipedia.org/wiki/Manual_labour)...urgh...I have to take a part out a box of parts, process it and put it back in the box. To make this more interesting I try to sort the parts as I do this, as each part has a unique alphanumer... |
[Question]
[
What general tips do you have for golfing in Mini-Flak? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Mini-Flak (e.g. "remove comments" is not an answer).
Please post one tip per answer.
Mini-Flak is just Brain-flak without `[]`, `<.... |
[Question]
[
**This question already has answers here**:
[I'm too cold, turn up the temperature](/questions/104372/im-too-cold-turn-up-the-temperature)
(53 answers)
Closed 7 years ago.
`This is a code golf. The smallest amount of bytes wins! :)`
# What you need to do
You're on Deep Space Nine, a Cardassian... |
[Question]
[
I want to write a function `golf(C, A)` that takes the height (`C = 2*c`) and the width (`A = 2*a`) of an oblate (left image) or prolate (right image) spheroid or a sphere as parameters and returns the volume `V` and the surface area `S` of the shape as tuple. The output must be rounded to two decima... |
[Question]
[
Italian zipcodes are 5-digit numbers. Each number is linked to a province. There are 4610 zipcodes and 110 provinces (as of 2015) in Italy.
Given the list of zipcodes and the related province (in [this](https://sites.google.com/site/dantonag/home/italianCAP.txt) file - [Gist](https://gist.github.com/... |
[Question]
[
## Background
When playing an [RPG](https://rpg.stackexchange.com/) such as [Dungeons & Dragons](https://en.wikipedia.org/wiki/Dungeons_%26_Dragons), [Pathfinder](https://en.wikipedia.org/wiki/Pathfinder_Roleplaying_Game), or [Paranoia](https://en.wikipedia.org/wiki/Paranoia_(role-playing_game)), pla... |
[Question]
[
# Introduction
Local genius [Calvin's Hobbies](https://codegolf.stackexchange.com/users/26997/calvins-hobbies "Calvin's Hobbies") recently challenged us to [trace the hue of an image](https://codegolf.stackexchange.com/questions/47790/tracing-the-hues-of-an-image "Original Challenge").
It is recommen... |
[Question]
[
Mr. Moneybags is a very rich man. He has an assistant Mr. Perfect, who one day, got very mad, and shredded some of Mr. Moneybag’s $100 bills! Mr. Moneybags decided to punish Mr. Perfect.
Mr. Moneybags tells Mr. Perfect to stack his money into different piles.
He starts with N (1 <= N <= 1,000,000, ... |
[Question]
[
You have to make a golf game with the following specification :-
1. The field is 10 X 10 characters without spaces.
2. Free ground is represented by `.`
3. A hole generated at random(not at `0,0`) is shown by `O` (its alphabet and not zero).
4. The ball starts at `0,0` represented by `X`.
5. You can ... |
[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/12499/edit).
Closed 5 years ago.
[Improve this question](/posts/12499/edit)... |
[Question]
[
Your task is to build a function in any language that takes a message `m`, an encryption `e`, and a modulus `k` (all positive integers), and takes `m` to the power of `e` modulo `k`. Your solution must not be a theoretical one, but one that would work on a reasonable computer such as your own, for RS... |
[Question]
[
Arturo is a bytecode-compiled/interpreted, garbage-collected general-purpose language filling a role similar to JavaScript, Python and Ruby. It is centered around the concept of blocks, which hold code just as easily as data. It uses fixed-arity prefix syntax and emphasizes the procedural and functio... |
[Question]
[
Write a program that takes an undirected graph and finds the minimum cut, i.e., the set of edges that, if removed, would disconnect the graph into two or more connected components. The program should have a time complexity of \$O(n^2m)\$, where n is the number of vertices and m is the number of edges... |
[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.
---
Santa and the Elves are secretly preparing for a new tourist train service, called "... |
[Question]
[
I wrote this function in 48 bytes and I wonder, is there any way to write this code 2 characters shorter?
```
p=lambda n,c:(n*c)[:n//2]+(n*c)[:n//2+n%2][::-1]
```
The point of the function is to create a palindrome of length `n` by using all the characters from the string `c`. Example: `n = 3`, `c = ... |
[Question]
[
This is a version of [this question](https://codegolf.stackexchange.com/questions/197524/average-number-of-strings-with-levenshtein-distance-up-to-3) which should not have such a straightforward solution and so should be more of an interesting coding challenge. It seems, for example, [very likely](ht... |
[Question]
[
Below Python code generates memory leak.
**Challenge**: Fix the memory leak with minimal changes to the code as measured by Levenshtein distance to the original code. You may only change the code before `t` is initialised. When the `del t` line is removed the modified program should print `I'm still... |
[Question]
[
**This question already has answers here**:
[Print the N-bonacci sequence](/questions/70476/print-the-n-bonacci-sequence)
(44 answers)
Closed 5 years ago.
## How to
Given an integer `n` start with `n` ones (i.e. 4 -> `1 1 1 1`). Then sum up the
last `n` numbers, and repeat.
For `n = 4` this l... |
[Question]
[
**This question already has answers here**:
[Shortest code that raises a SIGSEGV](/questions/4399/shortest-code-that-raises-a-sigsegv)
(84 answers)
Closed 6 years ago.
We've had challenges for [SIGSEGV](https://codegolf.stackexchange.com/questions/4399/shortest-code-that-returns-sigsegv/62668#... |
[Question]
[
Write the shortest possible code which converts tabs to spaces in the input. Tab size should be supplied as a parameter or be hardcoded in the code **in a single place**.
Spaces on output should point to the right column, e.g. (`\t` represents a tab character):
```
a\tb
aa\tb
aaa\tb
aaaa\tb
```
shoul... |
[Question]
[
I'm new to [Japanese Mahjong](https://en.wikipedia.org/wiki/Japanese_Mahjong) and have trouble [calculating the scores](https://en.wikipedia.org/wiki/Japanese_Mahjong_scoring_rules). Please help me write a program to calculate it.
# Introduction
(aka you can skip this boring part)
[Mahjong](https://e... |
[Question]
[
# Why don't you grow up?
In the past week a meme involving the young actor Aaron Bailey became trending in most Brazilian social networks. Entitled "why don't you grow up" it consists in repeating a sentence replacing its vowels with `i`s (it's a bit more complicated than that, I'll explain below). A... |
[Question]
[
# Intro (semi fictional)
I'm the solo developer of a game, I'm already struggling with character design as is. Hence I've thought of a smart solution, I'll just use images for regular monsters, outline them a bit and suddenly they are boss monsters! That will save me from thinking up new bosses yay. ... |
[Question]
[
A peer of mine approached me with this challenge and I wasn't able to come up with an elegant solution. After discussing my approach, we began to wonder what the people at Code Golf would come up with.
# Given
* A processor that implements only two instructions:
1. STO <register>, <address> (`store`... |
[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/24297/edit).
Closed 6 years ago.
[Improve this question](/posts/24297/edit)... |
[Question]
[
**Context:** We are working on a complex image drawing program to produce mugs, t-shirts, and so on. Here is an example of such function

However, we are facing the following problem: Random generated functions are mostly white and black (where black is close t... |
[Question]
[
Definition: a **set** is a datatype which allows testing of inclusion ("does set X contain element Y?") but does not have order. Its size is the number of distinct elements it contains.
Define an efficiently invertible injection from sets of `k` integers in the range 0 to 1000 inclusive to sets of `k... |
[Question]
[
**This question already has answers here**:
[Code Golf of Death [closed]](/questions/6249/code-golf-of-death)
(12 answers)
Closed 10 years ago.
A shortest C program, that can crash the Operating system, either on a Windows or a Linux PC...
**Rules**:
* The code is to be developed in C language... |
[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 5 years ago.
[Improve this que... |
[Question]
[
Your task is to write a function which accepts a number N and creates a string of [Reverse Polish Notation](http://en.wikipedia.org/wiki/Reverse_Polish_notation) which will generate that number. Valid operations are:
```
1-9: Push number onto stack. Only 1-9 are allowed.
+-*/%: take two numbers from ... |
[Question]
[
On [Pomax's Primer on Bézier Curves](https://pomax.github.io/bezierinfo/#canonical) this "fairly funky image" appears:

This is related to the fact that every cubic Bézier curve can be put in a "canonical form" by an affine transformation that maps its first th... |
[Question]
[
Usually each cell in brainfuck has 256 states, which is not enough to tell whether input is EOF or a character (usually `\xFF`). To fix it we can add one more state to it, and EOF (256) isn't mistake from a byte.
Since outputting EOF is also not defined, `.` on 256 works as reading, and therefore `,`... |
[Question]
[
The Levenshtein distance between two strings is the minimum number of single character insertions, deletions and substitutions needed to transform one string into the other. Let us call insertions, deletions and substitutions "edit operations". We will say that any sequence of \$k\$ edit operations t... |
[Question]
[
Given a UTF-16 string, test its endianness.
**Rules:**
1. As long as the input is in UTF-16 **without BOM**, its type doesn't matter. In C++ on Windows, it can be `std::wstring` or `std::u16string`. In Haskell, it can be `[Int16]` or `[Word16]`.
2. The endianness is tested by noncharacters. If the in... |
[Question]
[
Here is my ungolfed Ruby code for a function I want to try and golf:
```
Iter =-> k {
str = ""
(0..k).map{|m| str += "-> f#{m} {"}
str += "f#{k}.times{f1 = f0[f1]};f1"
(2..k).map{|m| str += "[f#{m}]"}
eval(str + "}" * (k+1))
}
```
The best I can do to golf this is essentially shor... |
[Question]
[
# Introduction
I've seen throughout the code-golf challenges several simple tasks involving JSON, such as interpreting JSON strings with RegExs, and almost every other manipulation I could think of.
In a binding for [AppleScript](https://github.com/TooTallNate/node-applescript) that I was using for a... |
[Question]
[
Covalent bonding uses so-called "hybrid" orbitals to form tetrahedral, octahedral, etc. formations out of the *s*, *p*, and sometimes *d* orbitals. Their naming conventions are pretty much the concatenation of the component orbitals; for example, the hybridization of the *s* orbital and one *p* orbit... |
[Question]
[
In the IRC protocol, raw messages look similar to this:
```
command arg1 arg2 :arg3 with spaces :arg4 with spaces :arg5
```
In a shell environment (e.g. bash), that would be equivalent to:
```
command arg1 arg2 "arg3 with spaces" "arg4 with spaces" arg5
```
The format specification is as follows:
* R... |
[Question]
[
**Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers.
---
This site is for programming contests and challenges. **General programming questions** are off-topic here. You may be able to get help on [Stack Overflow](http://stackoverflow.com/about)... |
[Question]
[
### 100 Prisoners and a light bulb
You may have seen this puzzle over on the puzzles exchange or perhaps heard it somewhere else. If you are unfamiliar with this puzzle check out:
[100 Prisoners and a Light bulb](http://www.cut-the-knot.org/Probability/LightBulbs.shtml)
The gist of this puzzle... |
[Question]
[
**This question already has answers here**:
[Trump needs your help to stop the Starman!](/questions/64476/trump-needs-your-help-to-stop-the-starman)
(22 answers)
Closed 7 years ago.
Write a program or function that takes an input greater than or equal to 2. It should output a truthy or falsy v... |
[Question]
[
**Requirements**
You need to make a smiley face go from smiling to frowning and back. There needs to the below faces in the code: **Smiling, no expression, frowning, no expression, and then back to smiling.** The new face needs to replace the old face flipbook style so that there's only one face on t... |
[Question]
[
**Closed**. This question needs [details or clarity](/help/closed-questions). It is not currently accepting answers.
---
**Want to improve this question?** Add details and clarify the problem by [editing this post](/posts/54285/edit).
Closed 8 years ago.
[Improve this question](/posts/54285/edit)... |
[Question]
[
This is my first code golf challenge, as such I am not entirely certain if it is suitable as a Code Golf challenge, but it's all a learning experience.
The challenge is that in as few characters as possible, using whichever language you prefer, develop a code to complete the following:
1. Take a valu... |
[Question]
[
I'm pretty new to code golfing, so I gave one of my first shots to a space invader clone called ["Invas!on".](https://gist.github.com/misantronic/7700fc01484a22c2c717) It's a little less than 500 bytes, fully ASCII generated, and covers moving around and shooting at the aliens. There is also a little... |
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.