text stringlengths 180 608k |
|---|
[Question]
[
\$BB\$ is the [busy beaver function](https://en.wikipedia.org/wiki/Busy_beaver), an uncomputable function.
Write a program which when given an integer \$n\$ as input, will output \$BB(n)\$, with at least \$\frac 2 3\$ probability. You can do whatever (return something wrong, infinite loop, explode, e... |
[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/213767/edit).
Closed 3 years ago.
[Improve this question](/posts/213767/edi... |
[Question]
[
*Related to, but not a duplicate of, [this challenge](https://codegolf.stackexchange.com/questions/74830/read-an-analog-clock).*
## Basics
This is a clock:
```
******
** | **
** | **
* | *
* | *
* ... |
[Question]
[
This challenge is a sequel to [Letter Boxed Validator](https://codegolf.stackexchange.com/questions/183213/letter-boxed-validator).
The New York Times has a daily online game called [Letter Boxed](https://www.nytimes.com/puzzles/letter-boxed) (the link is behind a paywall; the game is also described ... |
[Question]
[
**Background:**
This question is a remix of the one that I made previously on this forum. The only difference with this one is: the range is significantly larger, AND dynamic. Details below!
Also, I'm typing this question incredibly quickly, so if there are any grammatical errors, I do apologize and ... |
[Question]
[
Programs often list outcome statistics, such as this:
* 54% of participants received an award
* 69% of participants got a promotion
* 85% of participants increased their salary
These percentages are the result of dividing *a*/*x*, where both *a* and *x* are whole numbers, and the result is rounded to... |
[Question]
[
Inspired by [this](https://codegolf.stackexchange.com/questions/138068/kill-it-with-fire) and [this](https://codegolf.stackexchange.com/questions/138108/will-i-make-it-out-in-time) which was inspired by the first question.
I've set my farmers' fields on fire, but unfortunately they saw me do it! If I... |
[Question]
[
# Cyclic Polyglot Challenge
*This is the robbers thread. You can find the cops thread [here](https://codegolf.stackexchange.com/questions/129866/cyclic-polyglot-challenge-cops).*
## Cyclic Polyglot
A N-element cyclic polyglot is a complete program that can be run in N different languages. In each lan... |
[Question]
[
>
> ### Disclaimer
>
>
> It is bad practice to draw out your molecules in 2 dimensions because that is not how they are. I chose to do this in 2D because it is easier to explain.
>
>
> Note that the bond angles are wrong too: the angle in CH4 is 109.5°, not 90° as I said and the bond angle in NH... |
[Question]
[
Your task is to generate the "Primitive and Basic" numbers, which are made like so:
Start with **110**. Take the digits of its base-1 representation (**110 = 11**) and interpret them as base-2 digits. This gives **12 = 110**. Now, add the second prime number – **310** – to the result. This will give ... |
[Question]
[
**This question already has answers here**:
[Print this diamond](/questions/8696/print-this-diamond)
(133 answers)
Closed 7 years ago.
Inspired by [**this**](https://codereview.stackexchange.com/questions/134184/java-diamond-with-numbers), print an ascii diamond pattern built using `0-9`.
**Ru... |
[Question]
[
Given a mapping from the integers from 1 to N to the integers from 1 to N, determine if the mapping is surjective, injective, bijective, or nothing.
You may choose any character/digit for the four outputs.
# Specs
Input format: `n, arrays of pairs` (`n` is the highest number in the domain and range)
... |
[Question]
[
For this challenge, you need to print out the fingerings for various brass instruments.
The notes an instrument can play (as well as their fingerings) are listed below:
```
Cornet Baritone
Trumpet Bugle French Horn Euphonium Tuba
A#0 ... |
[Question]
[
If you have ever travelled with kids more than about 20 minutes, you will have no doubt heard cries of **"Are we there yet?"** and **"How much further?"**
So we play games like *"I Spy"* to help pass the time as the miles go by.
There is a variation on *"I Spy"* whereby instead of spotting arbitrary ... |
[Question]
[
# The obstacle course
You are currently stuck in some kind of course and you have to escape. However, if you do not choose the fastest way then the exit will close in front of you. Your challenge is to find the fastest route in an obstacle course.
**Input**
Your input consists of a list with lists in... |
[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 8 years ago.
[Improve this que... |
[Question]
[
A [covering array](http://math.nist.gov/coveringarrays/coveringarray.html) is an `N` by `k` array in which each element is one of {0, 1, ..., v-1} (so `v` symbols in total), and for any `t` columns chosen (so an `N` x `t` array) contains all possible `v^t` tuples at least once. The applications of Co... |
[Question]
[
You should write a program or function which given a text as input outputs or returns the sum of the following three integers:
* Number of lowercase `x`'s which are not part of a cross-formation.
* Number of uppercase `X`'s which are not part of a cross-formation.
* Number of cross-formations which a... |
[Question]
[
# The Setup
Most of us are familiar with crossword numbering, which follows three basic rules:
1. in a character grid consisting of blacks and whites (see below), any maximal contiguous horizontal or vertical chain of whites with length ≥ 2 is considered a word
2. any white at the leftmost end of a h... |
[Question]
[
Your task is to take as input an English noun and output its plural. To win the challenge you must trade off code length against accuracy.
Entries will be scored according to this comma-separated list of [95642 English nouns and their plurals](https://gist.github.com/anonymous/2e26552ad78d29489bd9). ... |
[Question]
[
A station model is a diagram for recording the weather at a certain place and time.
# Challenge
You must write the shortest code possible to graphically output a simplified (explained later) station model.
 is a puzzle game from the collection of Simon Tatham. The previous link contains a javascript implementation of a Loopy puzzle generator. I suggest everybody who wants to attempt this challenge to solve a couple of puzzles man... |
[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/15906/edit).
Closed 10 years ago.
[Improve this question](/posts/15906/edit... |
[Question]
[
## Objective
Given an arbitrary chessboard as standard input (in which each piece is on a square), produce as standard output a list of moves needed to regularize, or set up, the chessboard. The moves need not be legal, yet no piece may be placed above another. The program must warn about any missing... |
[Question]
[
## Background
You know how in text editors and just text fields in general, there's always that blinking bar where you type? Yeah, simulate typing there.
You'll be given 3 inputs: The current text field, the position of the cursor, and the input sequence.
Here's an example:
```
Hello, World!
5
[U];[U... |
[Question]
[
I'm trying to solve a [CSS challenge](https://cssbattle.dev/play/141). It contains a rotated leaf shape (looks like an eye). Score for the challenge depends on amount of characters of the code. Here's my way to make a leaf shape:
```
div {
width: 200px;
height: 200px;
border-radius: 99% 0;
ro... |
[Question]
[
In [this question](https://codegolf.stackexchange.com/q/247699/) I asked you to determine if a run ascending list could be made. It was code-golf so naturally most the answers are very slow. But what if we want it to be *fast*. In this challenge I ask you to solve the same task except your goal will ... |
[Question]
[
It's mentioned last time that, in [Hearts](https://en.wikipedia.org/wiki/Black_Lady),
>
> Each round every player gets a non-negative amount of *points*. The sum of the points is 26, and at least one player gets 13 or more points.
>
>
>
Actually, it's the game part:
1. Average the 52 cards (♠♡♢♣ ... |
[Question]
[
For a computer vision app I want to do a mapping of an image, in such a way that every pixel fit [hilbert curve](https://en.wikipedia.org/wiki/Hilbert_curve), instead of conventional layout. So task could be as follows:
---
## Task description
Given square 2D image `A` with side `2^^N`, (`N>0`), wit... |
[Question]
[
Dina loves most numbers. In fact, she loves every number that is not a multiple of n (she really hates the number n). For her friends’ birthdays this year, Dina has decided to draw each of them a sequence of n−1 flowers. Each of the flowers will contain between 1 and n−1 flower petals (inclusive). Be... |
[Question]
[
Given an inconsistently indented piece of html code your task is to return the same text but correctly indented
* Indent space = 4
* Assume input will be non-empty.
* Input can be taken as string or array/list of lines
* Opening and closing tags must be on the same line as long as there is not any o... |
[Question]
[
A while ago, I posted a challenge asking to determine whether or not it's possible to arrange arbitrary rectangles to fill a rectangular space, [here](https://codegolf.stackexchange.com/q/96901/42649). That got answers, so clearly it was too easy. (Just kidding, it was fairly challenging, congrats to... |
[Question]
[
**This question already has answers here**:
[Dames, do some math!](/questions/61463/dames-do-some-math)
(2 answers)
Closed 7 years ago.
Scrolling through social media, one might encounter something like this:
[](https://i.... |
[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/105564/edit).
Closed 7 years ago.
[Improve this question](/posts/105564/edi... |
[Question]
[
### The Definition
Given an integer `x`, a version series is a set of digits (base 10) from which any `x`-length subset of consecutive members is unique compared to all other possible subsets of the same length (a unique "version").
### The Task
Write a function which, when passed some subset length ... |
[Question]
[
# Extended Train Swapping Problem
### Part 1: Normal Train Swapping Problem
In the 1996 CCC (Canadian Computing Competition), the first Stage 2 problem was a Train Swapping Problem. You can visit the link [here](http://cemc.uwaterloo.ca/contests/computing/1996/stage2/21a-prob.html "here"). Essentiall... |
[Question]
[
## Introduction and Motivation
I'm mainly active on [Cryptography.SE](https://crypto.stackexchange.com/) and as such have already stumbled across the question: "How the hell am I supposed tools like cado-nfs to *do* stuff!?". They are super-complicated tools for a super-complicated task: [Factoring](... |
[Question]
[
In chemistry class, we were learning about titrations, and attempting one as a lab. We were using phenolphthalein as the indicator for the titration, so on top of grading the lab normally, my teacher held a little contest to see who had the lightest shade of pink, and thus the most accurate transitio... |
[Question]
[
## Congratulations!
You have just been hired by a Fortune 499 company specializing in oil drilling.
Your job is to write a program to determine the optimum placement of OilRUs' drill (represented by a single alphabetical character of your choice, I use a capital "O" in the examples), given a length o... |
[Question]
[
The keypad on my office phone has the following layout:
```
[1] [2] [3]
/.@ ABC DEF
[4] [5] [6]
GHI JKL MNO
[7] [8] [9]
PQRS TUV WXYZ
[*] [0] [#]
+ _
```
### Task:
Write a program that, given an input string, returns a list of instructions that my fingers need to follow in order the t... |
[Question]
[
It's almost Christmas, so Santa has to plan his route. You're helping him, for reasons unknown.
Santa needs help planning the route and wants you to give him a solution, but since you're all ungrateful and unwilling to give to the man who has given you so much, so have decided to give him a program w... |
[Question]
[
Write a program that fills in the paths of a grid of characters (ASCII 20-7E) according to the following rules.
The path is governed by eight directional characters: `-`, `|`, `/`, `\`, `&`, `@`, `%`, and `*`, as specified in the table below. The direction of the path will change when it reaches one ... |
[Question]
[
# Description
You, an armchair cryptanalyst, have noticed that the first letters of each word in your neighbor's mail (yes, you read it -- how else would you know if he's plotting something?) look very suspicious put together. To make sure that his mail is safe to send to its destination, you need to... |
[Question]
[
Given a list of integer points in an *n*-dimensional space, output the [geometric median](https://en.wikipedia.org/wiki/Geometric_median). Note that the output is not necessarily integer. Your answer must be precise to at least two digits after the decimal point.
You may assume that *n* < 16 and that... |
[Question]
[
## Brief
* Print an ASCII representation of a binary search tree.
* You should write your own minimum implementation logic of a BST (node, left, right, insert)
```
(50,30,70,20,80,40,75,90) gives:
__50__70__80__90
| |
| |__75
|
|__30__40
|
|__20
```
## Detailed r... |
[Question]
[
## Introduction
What you have to do is, given an an ASCII diagram of a chemical, output the chemical formula.
## Rules
Your code must not access the internet and may not use a stored library of molecules. You may have a library of elements.
You must verify all of the elements included in the formula ... |
[Question]
[
Australia (and many countries) has a perferential voting system,
where voters, number the candidates from 1 - n, where n is the number of candidates,
in order of preference.
Until a candidate gets a absolute majority of votes, the number 1 votes for the candidate with minimum count of number 1 votes,... |
[Question]
[
Given a set of bit vectors \$A\$ and a binary matrix \$M\$, we can define the set \$MA = \{ Mx : x \in A \}\$, where \$ M x \$ is the result of the [matrix multiplication](https://en.wikipedia.org/wiki/Matrix_multiplication) of \$ M \$ by \$ x \$ over \$\mathbb{F}\_2\$, the field with two elements.
G... |
[Question]
[
Once upon a time I wanted to order custom tokens for a board game. They say they can do it, and then they present me their price list. I was confused because they charge per inch of head movement, and I have no idea how much will my tokens cost.
**INPUT:** a 2d grid:
* `|`,`-`,`\`,`/` are straight cu... |
[Question]
[
The inspiration for this code golf puzzle is the [Bridge and Torch problem](https://en.wikipedia.org/wiki/Bridge_and_torch_problem), in which ***d*** people at the start of a bridge must all cross it in the least amount of time.
The catch is that at most two people can cross at once, otherwise the br... |
[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 6 years ag... |
[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/130149/edit).
Closed 6 years ago.
[Improve this question](/posts/130149/edi... |
[Question]
[
Creating a golfing language can be hard. Let's help budding golfing language creators out and provide some helpful tips on how to create one.
I'm looking for tips on:
1. The design process
2. Implementation
3. Community engagement
One tip per answer would be appreciated, and tips like "don't create a... |
[Question]
[
# The Challenge
I was looking into small code examples for a specific language as a small tutorial and came accross a simplified Blackjack that should be implemented. In this Challenge you will have to implement a full Blackjack game, with 5 Decks.
# The Game
You are playing against a Dealer and he h... |
[Question]
[
In scientific computing, it is often desirable to decompose some large domain into smaller "subdomains", then parallelize the computation by performing the work on each subdomain in parallel and the interaction of a subdomain with its neighboring subdomains. Since these interactions are typically dat... |
[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/58451/edit).
Closed 8 years ago.
[Improve this question](... |
[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 8 years ago.
[Improve this que... |
[Question]
[
Let the characters `0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ` represent the particles of 36 [immiscible](http://en.wikipedia.org/wiki/Miscibility) fluids, each more [dense](http://en.wikipedia.org/wiki/Density) than the last. So the `0` fluid is the least dense and floats on all the others, while `Z` 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/6284/edit).
Closed 6 years ago.
[Improve this question](/posts/6284/edit)
... |
[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/23383/edit).
Closed 8 years ago.
[Improve this question](/posts/23383/edit)... |
[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/13071/edit).
Closed 8 years ago.
[Improve this question](/posts/13071/edit)... |
[Question]
[
**Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers.
---
This question does not appear to be about code golf or coding challenges within the scope defined in the [help center](https://codegolf.stackexchange.com/help/on-topic).
Closed 7 years ag... |
[Question]
[
**This question already has answers here**:
[Generate any random integer](/questions/42786/generate-any-random-integer)
(21 answers)
Closed 7 years ago.
You have to create a code which prints
```
:)
```
a random number of times from 1 to 255 inclusive. Your output may not contain any whites... |
[Question]
[
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, [visit the help center](/help/reopen-questions).
Closed... |
[Question]
[
# Challenge
In this challenge, you are to code in any language a program or function that will take a string and replace certain characters within it with different characters.
# Input
The input is the same for both functions and full programs:
```
[string] [char1] [char2]
```
* `string` will be an i... |
[Question]
[
In [bash](/questions/tagged/bash "show questions tagged 'bash'"), this code posts `String to post` to `http://www.example.com/target`:
```
curl -d "String to post" "http://www.example.com/target"
```
**NOTE:** You should use **`http://www.example.com/target`** as the URL to `POST` to, without any cha... |
[Question]
[
[(related)](https://codegolf.stackexchange.com/questions/18028/largest-number-printable)
Your challenge is to output the highest number you can. You can output as a number or as a string. You must output something that matches the regex `^\d+$`, as in only 0-9.
# The Twist
Your source code must be:
... |
[Question]
[
It seems flags are a trend now, so what better place to start an account? I thought bars could use a twist to them, so I found this flag.
Produce the following in the console output the fewest possible bytes:
```
+----------------------------------+
|XXXXX |
|XXXXXXXX ... |
[Question]
[
*CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready?*
```
6779686932717976703238326711110010511010332671049710810810111010310111558327311032116111100971213911532991049710810810111010... |
[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/15648/edit).
Closed 6 years ago.
[Improve this question](... |
[Question]
[
Using a language of your choice write a program that takes a string as an input, and returns the string encrypted.
# Algorithm:
You should assume that each character is always encoded in a byte and is ASCII-based. The extended ASCII codes are mapped to whatever is the default code page in use by the ... |
[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/4419/edit).
Closed 6 years ago.
[Improve this question](/... |
[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/21465/edit).
Closed 9 years ago.
[Improve this question](... |
[Question]
[
The Riemann R function is as follows:
$$R (x)=\sum \_{n=1}^{\infty } \frac{\mu (n) \text{li}\left(x^{1/n}\right)}{n}.$$
This uses the [Möbius function](https://en.wikipedia.org/wiki/M%C3%B6bius_function) as well as the [logarithmic integral](https://en.wikipedia.org/wiki/Logarithmic_integral_function... |
[Question]
[
Given *N* items (0 < *N* <= 50) with prices (which are always integers) *P0* ... *PN-1* and given amounts of each item *A0* ... *AN-1*, determine how much the total cost will be.
### Examples
*N*: 2
*P0*: 2
*P1*: 3
*A0*: 1
*A1*: 4
Result: 14
*N*: 5
*P0*: 2
*P1*: 7
*P2*: 5
*P3*: 1
... |
[Question]
[
Write a program that checks if a given positive integer can be represented as sum of two or more consecutive positive integers.
### Example:
43 can be represented as 21 + 22
10 = 1+2+3+4
but 4 cannot be represented in this way.
**Input spec:** positive integer (as argument or stdin)
**Output spec:** ... |
[Question]
[
## The Rules
* Each submission must be a full program or a function.
* The program must take all instances of the string `2015` from the input (1 string), replace it with `<s>2015</s>*` (with <s> or <strike>). At the end, if there has been at least one `2015` in the string, you must add a newline and... |
[Question]
[
Notice the pattern in the below sequence:
```
0.1, 0.01, 0.001, 0.0001, 0.00001 and so on, until reaching 0.{one hundred zeros}1
```
Then, continued:
```
0.2, 0.02, 0.002, 0.0002, 0.00002 and so on, until reaching 0.{two hundred zeros}2
```
Continued:
```
0.3, 0.03, etc, until 0.{three hundred zeros}... |
[Question]
[
One way to construct a regular [heptadecagon](https://en.wikipedia.org/wiki/Heptadecagon) starts with drawing a horizontal line of length `1` from the center to a vertex. Then the distance along that line from the center to the second vertex is `cos(2π/17)`. All other vertices are easy to get.
The go... |
[Question]
[
Came over a similar problem in a project I'm working on and found it quite hard to solve it without excesive use of `if`. I'm eager to see if anyone can come up with more elegant solutions to this, with the aribitary numbers I have given to the line segments.
### The problem
You are given two integer... |
[Question]
[
**Inputs:**
* `current hour`: from 0 to 23 (inclusive)
* `delta of hours`: `[current hour]` + `[delta of hours]` = withing the range of `Integer`
**Output:**
* `delta of days`: the value which shows difference in days between day of `current hour` and day of sum `[current hour]` + `[delta of hours]`... |
[Question]
[
What is the shortest C expression that is defined to evaluated to false the first time and true for every time after that:
Reference implementation:
```
bool b = false; // you get this for free.
(b ? true : b = true, false) // only this line is measured.
```
[Answer]
### 3 chars:
As Keith Ra... |
[Question]
[
**This is not a duplicate of [Sum of combinations with repetition](https://codegolf.stackexchange.com/questions/155938/sum-of-combinations-with-repetition). This question considers `1+2` to be the same as `2+1`. The other question doesn't.**
---
[OEIS link - A000008](https://oeis.org/A000008)
---
## ... |
[Question]
[
You should a program in language X, which will only output its source code (i.e function as a quine) when it is not a monday. On monday it should output some string with a levehnstein distance of 4 from the source code. i.e if the code is aaaa on sunday it should output aaaa and on monday it could ou... |
[Question]
[
My teacher gave me a simple problem which I should solve with a code tiny as possible. I should print all odd numbers from 0 to 100000 into a HTML document using javascript.
```
for(var y = 0; y < 100000; y++){
if(!(y % 2 == 0)){
document.write(y + " ");
}
};
```
Is it possible to do that shorter?
... |
[Question]
[
…without using any operator/function besides addition (`+`), subtraction (`-`), multiplication (`*`), division (`/`), modulo (`%`), exponent/power `pow()` or any of the standard C bitwise operators (`<<, >>, ~, &, |, ^`) or unary operators (`—, ++`) or assignment/comparison operators (`=, ==`).
If th... |
[Question]
[
**This question already has answers here**:
[Reimplement the wc coreutil](/questions/74222/reimplement-the-wc-coreutil)
(23 answers)
Closed 7 years ago.
Write a stripped down version of the wc command. The program can simply open a file which does not need to be configurable or read from stdin... |
[Question]
[
Word equations, but not as you know it! Given a sentence which will include two numbers, numerically, and a spelt operator, in the order seen in the examples, your goal is to give the numerical answer
The operators will be spelt as: "add", "minus", "times" and "divide"
Any ~~real number~~ integer may... |
[Question]
[
A few hours earlier, I got this puzzle:
>
> Suppose, you toss a coin n times, then what is the probability of getting m number of heads? ( where m belongs to the *set of all prime numbers*)
>
>
>
For instance, take n = 2, then
`SS = { HH, HT, TH, TT }`
So, output is 1/4 (for HH case)
Then, for ... |
[Question]
[
Your task is to build a piece of code that generates an aperiodic sequence of integers, either by outputting one every time it iterates, or by taking an integer `n` and returning the `n`th number in that sequence.
Now, the sequence `1, 2, 3, 4, 5, 6, ...` is itself aperiodic, so I'm going to introduc... |
[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/165573/edit).
Closed 5 years ago.
[Improve this question](/posts/165573/edi... |
[Question]
[
We already have challenges to [check if a string of brackets is fully matched](https://codegolf.stackexchange.com/q/77138/48022) and to [count the number of balanced strings](https://codegolf.stackexchange.com/q/66127/48022). It remains for us to generate these strings, but it will not be so easy…
A ... |
[Question]
[
Your program will be given a number as input. Your challenge is to output all the numbers between 2 and 100 inclusive that are co-prime to the given number. (Two numbers are co-prime if their GCD is 1.) If no numbers between 2 and 100 are co-prime to the given number, the program shall not output any... |
[Question]
[
# Output all numbers in certain range containing certain digits
### Task
1. Take an input of digits through console, prompt, or a file (in the decimal number system). These digits should be separated by spaces.
2. Take an input of the "maximum" through console, prompt, or a file
3. If you use a file,... |
[Question]
[
Given a string representing a number and the base that number is in, shift each positional value upward, wrapping back to zero if the value cannot increase. You will never be provided invalid input, nor a base larger than 36.
For example, you may be provided `['5f6', '16']`, which represents the numb... |
[Question]
[
Consider a 10 by 10 grid of points at integer coordinates. Given a coordinate (x, y) of one of the points in the grid and a radius r, some of the points in the grid will fall inside a circle of radius r that is centered at (x, y). You will count the number of such points.
# Input
An integer coordinat... |
[Question]
[
**This question already has answers here**:
[Is this number a prime?](/questions/57617/is-this-number-a-prime)
(367 answers)
Closed 6 years ago.
We define a *prime character* as a character that has a [prime](https://en.wikipedia.org/wiki/Prime_number) [ASCII value](https://en.wikipedia.org/wi... |
[Question]
[
# Bi-directional translator
The challenge is to create a translator that can translate a `[a-zA-Z ]` string into another string according to the mappings below. The translator should also be able to translate translated text back into its normal form (hence *bi-directional*). Case doesn't have to be ... |
[Question]
[
You are to write a program or function that outputs this exact text:
```
OPQRSTU
NQPONMV
MREDCLW
LSFABKX
KTGHIJY
JUVWXYZA
IHGFEDCB
```
May also be lowercase and trailing spaces and newlines are allowed.
Standard loopholes are disallowed
This is [code-golf](/questions/tagged/code-golf "show questions ... |
[Question]
[
**Introduction**
You belong to a council which oversees the destruction of corrupted worlds. When the council assembles, a single vote is taken. The ballot lists all nominated worlds. One is ultimately destroyed each time the council meets.
Due to a bug in user12345's code, [the council recently floo... |
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.