text stringlengths 180 608k |
|---|
[Question]
[
Consider these 15 ASCII [playing card](http://en.wikipedia.org/wiki/Standard_52-card_deck) patterns (ace through Joker, and the back side), where `X` is a placeholder for the [suit](http://en.wikipedia.org/wiki/Suit_(cards)) symbol: (they look better with less line spacing)
```
------------- -------... |
[Question]
[
[Befunge](https://en.wikipedia.org/wiki/Befunge) is a 2-dimensional esoteric programming language. The basic idea is that (one-character) commands are placed on a 2-dimensional grid. Control flow walks across the grid, executing commands it passes over, and changing direction when it hits an arrow (`>^... |
[Question]
[
## Background
I was inspired by [3Blue1Brown](https://www.youtube.com/channel/UCYO_jab_esuFRV4b17AJtAw)'s recent [video](https://www.youtube.com/watch?v=FhSFkLhDANA) about the [necklace splitting problem](https://en.wikipedia.org/wiki/Necklace_splitting_problem) (or as he calls it, the stolen necklace ... |
[Question]
[
This question is about [abelian sandpiles](https://en.wikipedia.org/wiki/Abelian_sandpile_model). Read [this previous challenge](https://codegolf.stackexchange.com/questions/92251/build-a-sandpile) and [watch this numberphile video](https://www.youtube.com/watch?v=1MtEUErz7Gg) to learn more.
---
An abe... |
[Question]
[
The order of operations, PEMDAS, is a basic rule in mathematics telling us which order operations should be performed:
"Parentheses, Exponents, Multiplication and Division, and Addition and Subtraction"
The problem is, PEMDAS is not very versatile! What if you wanted to do it in another order? We won't... |
[Question]
[
You're given a tree, which in computer science tradition, has the *root* at the top and *leaves* at the bottom. The leaf nodes are labelled with numbers. Your goal is to take the special leaf marked `-1` and move it up to be the new root.
`[3, [[16], -1], [4]] --> [[[[4], 3], [16]]]`
![enter image desc... |
[Question]
[
Dark black ink has splattered all over your white sheet of printer paper! The obvious solution is to fold the paper so black and white parts meet and both become grey as the ink diffuses. Then unfold and refold until your paper is all equally grey.
Finding the best way to make these folds is your task ... |
[Question]
[
Write a program in your chosen language which plays a perfect game of tic-tac-toe on a 3 \* 3 board against a human player. However, **every move has to be a different program**, generated from the previous iteration.
How and in what form you evaluate human input, is up to you, but it has to be read fr... |
[Question]
[
## Background
One kind of river-crossing problems involves two kinds of animals. One such problem reads like this: (all wordings, including animal species, are arbitrary)
>
> A farmer has to cross a river with three chickens and three dogs. There's a boat which can only fit the farmer and at most two ... |
[Question]
[
[OG post](https://codegolf.stackexchange.com/questions/202894/how-happy-is-this-emoticon)
# Task
In this challenge, you will be given an string emoticon, and your task will be to output its happiness.
## How?
An emoticon will always have eyes and mouth. It can also include eyebrows and nose. Each part ... |
[Question]
[
# Introduction
The [Boids Algorithm](https://en.wikipedia.org/wiki/Boids) is a relatively simple demonstration of emergent behavior in a group. It has three main rules, as described by its creator, Craig Reynolds:
>
> The basic flocking model consists of three simple steering behaviors which describe ... |
[Question]
[
Many people know what a [truth machine](https://esolangs.org/wiki/Truth-machine) in programming is. But is time we kick things up a notch. Introducing, the extended truth machine! An extended truth machine takes two things as input, a integer `n` and a nonempty string `s`. It outputs `s` `n` times with... |
[Question]
[
I recently got a really weird irregular chess board. It's squares are all over the place and not even all connected. At least they're still laid out on a regular grid. I want to adapt the chess rules to be able to play on the board, but to start with, I need a piece that can actually go anywhere on the... |
[Question]
[
Your code is going to generate a very simple ASCII-art representation of DNA, forever. It will take two numbers as input in any format you want: as a list, as arguments to a function, on stdin, etc.
* A floating-point interval `I` in seconds between 0.0 and 1.0 (inclusive)
* A zoom level `Z` as an inte... |
[Question]
[
The challenge is to follow (draw) the path:
* `^n` - up by n lines
* `vn` - down by n lines
* `>n` - right by n character positions
* `<n` - left by n characters positions
---
* `n` is an integer, greater than zero (i.e. you can't receive a command like `>-2`).
* There're no separators between the comm... |
[Question]
[
Write a program or function that takes in an integer greater than 1 or less than -1. That is, the input won't be 0, 1, or -1.
If the input is `2`, the output should be:
```
|\_/|
|___|
```
If the input is `3`, the output should be:
```
|\_/\_/|
|______|
```
If the input is `4`, the output should be:
``... |
[Question]
[
**Objective:**
A guru once said a perfect code selfie is best shot diagonally from upper left corner. A code selfie is almost like a Quine - but rotated 45 degree clockwise.
Your mission is to code a program that outputs a code selfie.
**Rules:**
1. You can use any programming language.
2. Your program... |
[Question]
[
In this challenge, you will be given a list of points. **These points lie on the perimeter of an imaginary square**. Your goal is to:
1. If possible, print out the rotation of the square, which will be a value from [0, 90) where 0 represents a square with lines vertical and horizontal. The rotation is ... |
[Question]
[
This is my head:
```
\ /-- -|
/ -\ | | |
\ \ \ \ |
--\ | \ | |
/ |--| / / |
/|- //--| / |
| | || //\ |
| \ /| // \ |
```
It consists of exactly eight hairs. My hair is too long. Please cut each individual strand to a length I specify.
## Input
The main attraction... |
[Question]
[
# Find X
I was inspired by math questions in which one is asked to "Find X" for a given shape. Originally, I was just going to have the challenge be to print the x and y location of the character 'x' in a String. But I supposed that would be too simple. So I considered the context they were normally in... |
[Question]
[
## Challenge
Given a number `x` and a number `n`, round number `x` to `n` significant figures and output the result.
## Significant figures
The significant figures of a number are digits that carry meaning contributing to its measurement resolution. This includes all numbers *except* leading zeroes.
Be... |
[Question]
[
Inspired by [this](https://codegolf.stackexchange.com/q/63056/43319) wonderful (based on the number of views and votes) challenge, which, in my humble opinion, has way too few answers.
Given (by any means) a list of strings, return (by any means) a set of letters that, when removed from the given strin... |
[Question]
[
In various [Super Mario](https://en.wikipedia.org/wiki/Super_Mario) games [green](http://www.mariowiki.com/Green_Shell) and [red](http://www.mariowiki.com/Red_Shell) [Koopa Troopa](http://www.mariowiki.com/Koopa_Troopa) shells can slide frictionlessly on flat surfaces and destroy [brick blocks](http://... |
[Question]
[
We have been [cloning](https://codegolf.stackexchange.com/questions/24134/create-a-simple-2048-game-clone) 2048, [analyzing](https://codegolf.stackexchange.com/questions/24589/would-this-number-make-a-good-2048-combo) 2048, but why haven't we played it yet? Write a 555 byte javascript snippet to play 2... |
[Question]
[
Giving **`n`**(any amount) of points `(x,y)`. What's the minimum amount of circles required to cross every point given?
## Task
Your program will get `n` (you can have `n` as part of input or use EOF instead) points `(x,y)`.
The points might at same place => `(x1,y1) = (x2,y2)` **can happen**
`x` and `... |
[Question]
[
It's the end of the year, you and your friends have just received your grades and ranks for the GOLF101 class. On a chat group, everyone sends their grade and rank to see who's got the best one.
**Problem:** someone is lying.
Here is an excerpt from the chat:
```
<A> I'm ranked 1 with a grade of 85.
<B... |
[Question]
[
# The challenge
How well can you gerrymander North Carolina into 13 voting districts?
In this challenge, you use the following files to draw different maps for Republicans and Democrats.
**File 1:** [NC\_2016\_presidential\_election.csv](https://www.dropbox.com/s/rlwlcgz7ppd6vag/NC_2016_presidential_el... |
[Question]
[
This is a sequence question of the usual type, as applied to [OEIS sequence A038666](https://oeis.org/A038666). That is, do either of the following:
* Accept no or any input, and output A038666 until the heat death of the universe.
* Accept a positive integer as input, and output the \$n\$th term of A0... |
[Question]
[
In this challenge, we render Ascii user interfaces.
```
+----------------------+
|+-----------++-------+|
||<- Previous||Next ->||
|+-----------++-------+|
|== The title == |
| |
|Lorem ipsum dolor |
|sit amet... |
|+--------------+ |
||Post a comment| ... |
[Question]
[
This is [**Weekly Challenge #2.**](http://meta.codegolf.stackexchange.com/q/3578/8478) Theme: **Translation**
Write a program or function that takes in source code for a program in [Prelude](http://esolangs.org/wiki/Prelude) and outputs code for an equivalent program in [Befunge-93](http://esolangs.org... |
[Question]
[
# Challenge:
Given a Sudoku board on standard input, find the minimum number of numbers added to make the board unique.
## Specifics/Rules:
* The input is formatted as follows (all whitespace is significant)
```
516|827|943
278|394|615
349|615|872
---+---+---
98 |4 2|156
465|189|237
12 |5 6|489
---+---... |
[Question]
[
*"All roads lead to Rome"* is a saying that essentially means there are plenty of different ways of achieving an objective.
# Task
Your task is to write a program that finds a set of link connections from one Wikipedia page to the [Wikipedia page about Rome](https://en.wikipedia.org/wiki/Rome).
Notice ... |
[Question]
[
*This is the second in a series of Island Golf challenges. [Previous challenge](https://codegolf.stackexchange.com/q/113628/16766)*
Two hermits have arrived on a desert island. Since they came seeking solitude, they wish to live as far away from each other as possible. Where should they build their hut... |
[Question]
[
Consider the following string:
```
Tin Snips
```
This string contains several atomic symbols on the [periodic table](https://en.wikipedia.org/wiki/Periodic_table). We could rewrite this string to identify several of them:
```
[Ti][N] [Sn][I][P][S]
```
Of course, we could also write it this way:
```
T[I... |
[Question]
[
I was browsing esolangs, and chanced upon this language: <https://github.com/catseye/Quylthulg>.
One interesting thing about this language, is that it doesn't use prefix, postfix, or infix, it uses *all three of them*, calling it "panfix" notation.
Here is an example. To represent normal infix `1+2` in... |
[Question]
[
For every given degree \$n\$ it is possible to construct (at least one) an integral polynomial \$p \in \mathbb Z[X]\$ such that \$p(k)\$ (\$p\$ evaluated in \$k\$) is the coefficient of the term \$x^k\$ in the polynomial for all \$0 \leqslant k \leqslant n\$. To make them unique, we require the leading... |
[Question]
[
Being short of cash, you have signed up to build donuts for The Doughnut Shop™, the biggest digital doughnut company in the world, mostly because they sell every size of doughnut imaginable.
Now, given that trading standards nowadays is very tough, you need to write a piece of code as short as possible... |
[Question]
[
I heard somewhere that one thing that technology cannot do yet is fold towels1. So it is now your job to prove that statement false!
Given a string as input, made up of rectangles (towels), like the following, fold each towel in half twice. For example:
```
+------+ +------+ +--+
| | ... |
[Question]
[
# Intro
Consider a grid of the characters `f A\/` such as
```
f f f
A
A / \
\ / A
A \/
/
\/
```
where:
* `f` represents a faucet that pours a stream of water downward
* `A` bifurcates the stream of water above so exactly half goes left and exactly half goes ri... |
[Question]
[
I could only find code-golf challenges for Mastermind, so here's a code-challenge version that I would have liked to take on myself.
An optimal strategy for the normal Mastermind game, MM(4,6), was found by Koyama and Lai in 1993, having an average # of guesses = 5625/1296 ~ 4.34. MM(5,8) is still unso... |
[Question]
[
The goal is to create a preprocessor for the C language, as small as possible in terms of source code size *in bytes*, in your preferred language.
Its input will be a C source file, and its output will be the pre-processed source code.
The items that it will need to be able to process shall be:
Comment... |
[Question]
[
For mostly historical reasons, bash is quite a hodge-podge of syntax and programming paradigms - this can make it awkward and sometimes frustrating to golf in. However it does have a few tricks up its sleeve that can often make it competitive with other mainstream script languages. One of these is [bra... |
[Question]
[
# Introduction
In this challenge, your task is to decide whether a given sequence of numbers can be separated into two subsequences, one of which is increasing, and the other decreasing.
As an example, consider the sequence `8 3 5 5 4 12 3`.
It can be broken into two subsequences as follows:
```
3 5 ... |
[Question]
[
Python's [pickle module](https://docs.python.org/2/library/pickle.html) is used for serialisation, allowing one to dump an object in a way such that it can be later reconstructed. For this, pickle uses a simple stack-based language.
To keep things simple, we will be dealing with a small subset of this ... |
[Question]
[
The famous C64 basic one liner
```
10 PRINT CHR$(205.5+RND(1)); : GOTO 10
```
prints a maze of slashes and backslashes.
```
\\/\\\//\/\////\\/\/
\/\///\\///////\//\/
/\\\//\//\////\\//\\
\////\//\//\/\\\\\\/
/\/\\///\\\\/\\\\/\\
\/\//\\\\\\//\/\////
/\//\\///\/\///\////
\/\\\//\\/\\\//\\/\/
//////\\/\\... |
[Question]
[
You are the captain of a battleship. The engineering department's been cutting corners with designs this year, so the ship you're on takes the shape of a simple triangle.
You walk out onto the deck and enjoy the sea breeze... though not for long. An enemy has fired at you! — but will the shot hit?
## I... |
[Question]
[
You are given a bunch of weights, and your task is to build a small balanced mobile using those weights.
The input is a list of integer weights in the range 1 through 9, inclusive. There may be duplicates.
The output is an ascii picture of a mobile that, when hung, would balance. Perhaps best shown by ... |
[Question]
[
# The challenge
Given a list of words `["Programming", "Puzzles", "Code", "Golf"]` output the words crossword-style:
```
P r o g r a m m i n g
u
z
z
G l
C o d e
l s
f
```
# The Algorithm
* You have to process the list in the given order.
* The words are printed in alte... |
[Question]
[
In my Economics class, my friends and I like to come up with ways to rearrange the digits in the date (in MM/DD/YY) format to create a valid mathematical equation. For the most part, we are allowed to use addition, subtraction, multiplication, division, parentheses, and exponentiation in addition to co... |
[Question]
[
# The scene is:
Peter is at the gym with his buddy Brian when Brian suddenly is in dire need of his inhaler. Brian manages to tell Peter the code to his combination lock before he collapses on the floor.
The moment Peter gets to Brian's locker and sees what the indicator is pointing at, Stewie ambushes... |
[Question]
[
### Historical Background
The shield wall is a tactical war formation that dates back to *at least* 2500 BC. It consisted of warriors overlapping their shields with those of their companions to form a 'wall'. The appeal of the tactic comes from the fact that even the most unskilled warrior could fight ... |
[Question]
[
In the game Yahtzee, players take turns rolling 5 6-sided dice up to three times per turn, possibly saving dice between rolls, and then selecting a category they wish to use for their roll. This continues until there are no more categories (which happens after 13 turns). Then, players' scores are talli... |
[Question]
[
**Introduction**
My niece wants to make a race car track. She has wooden parts that fit together to form the track. Each part is square shaped and contains a different shape. I'll use the pipe drawing characters to illustrate:
* `│`: the road that goes vertically
* `─`: the road that goes horizontally
... |
[Question]
[
In this challenge, you will calculate what your reputation would be, if the reputation cap didn't exist on PPCG.
Everyone can access the rawdata for reputation changes on the adress: [codegolf.stackexchange.com/reputation](https://codegolf.stackexchange.com/reputation).
The raw data follows a setup lik... |
[Question]
[
# Background
A few months ago, the adventure of your life was just about to start. Now, in this precise moment (yeah, now), after months of suffering and hard work, you and a group of friends are standing on the top of the world. Yes, you are right, you are on the summit of [Sagarmāthā](https://en.wiki... |
[Question]
[
Your job is to simulate a mathematically perfect game of 2048. The idea is to find the theoretical upper limit of how far a 2048 game can go, and find how to get there.
To get an idea of what this looks like, play with [this 2x2 clone](http://ehzhang.github.io/4/) and try to score 68 points. If you do,... |
[Question]
[
Doorknobs are great and all, but when you open a door, it always dents the walls around it. I need you to take input of ASCII art of a room, like this:
```
+---------+--X --X --+-----+
| \ \ |\ | \ |
| \ \ | \ | \|
| X | \ | X
| / | ... |
[Question]
[
## Syntax
`~` not
`/\` and
`\/` or
`t` true
`f` false
`P`, `Q`, `FISH`, etc: variables
(Operators are given in order of precedence)
## Introduction
Some boolean formulae can be changed to different forms to make them shorter. For example, the formula
```
~(~P /\ ~Q)
```
can be changed to the ... |
[Question]
[
[0h n0](http://0hn0.com/) is a very simple and enjoyable game, a bit like Sudoku or minesweeper.
## Game rules
(I recommend using the [tutorial](http://0hn0.com/) in the game if you can, it is very simple and useful)
The puzzle starts with an `n * n` board containing some fixed pieces and some empty ce... |
[Question]
[
# Background
A [*matryoshka doll*](https://en.wikipedia.org/wiki/Matryoshka_doll) (or Russian nesting doll) is a set of dolls that fit inside of each other. I've accidentally mixed up my collection of matryoshka dolls and I don't remember which one goes inside which.
# Objective
Given a list of *unique... |
[Question]
[
# Introduction
I have a lot of ASCII rocks. They are built with dashes, pipes, Vs, carets, angle brackets, slashes and spaces. Example:
```
/--\
| |
| |
\--/
```
I want to erode them, like this:
```
/\
/ \
\ /
\/
```
All of the corners have become rounder. A more complicated example:
```
/----\
|... |
[Question]
[
[Next >>](https://codegolf.stackexchange.com/questions/149746/advent-challenge-2-the-present-vault-raid)
Descriptive Keywords (for searching): Make Two Matrices Equivalent, Overlap, Array, Find
# Challenge
Santa has had a history of elves stealing presents from his vault in the past, so this year he de... |
[Question]
[
# Introduction
[Skat](https://en.wikipedia.org/wiki/Skat_%28card_game%29) is a traditional German card game for 3 players. The deck consists of 32 cards: Ace, King, Queen, Jack, 10, 9, 8, 7 in all 4 suits (Clubs, Spades, Hearts, Diamonds).
In every round there one player plays solo while the other two ... |
[Question]
[
**Closed.** This question is [off-topic](/help/closed-questions). It is not currently accepting answers.
---
Questions without an **objective primary winning criterion** are off-topic, as they make it impossible to indisputably decide which entry should win.
Closed 2 years ago.
[Improve this quest... |
[Question]
[
**Locked**. This question and its answers are [locked](/help/locked-posts) because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
The challenge:
>
> Write a program or a function that inputs a positive number and returns its [f... |
[Question]
[
Your task is to create a program or function which **randomly** errors. Specifically, there must be a nonzero probability of erroring, but also a nonzero probability of running without error.
An error is anything that causes a program to terminate abnormally, such as dividing by zero or using an uninit... |
[Question]
[
This is an [answer-chaining](/questions/tagged/answer-chaining "show questions tagged 'answer-chaining'") question, which means that all answers are affected by those before them.
# The task
The *n*-th answer to this question must run in all languages that are present in answers before it. They need no... |
[Question]
[
Create a program which when run displays the text below:
```
)-*-*-*^_^*-*-*-(
| Welcome User! |
)-*-*-*^_^*-*-*-(
```
Use any functions or language to answer this, have fun. Shortest code wins
[Answer]
# [Python 2](https://docs.python.org/2/), 54 bytes
```
print(")-*-*-*^_^*-*-*-(\n| Welcome User... |
[Question]
[
The [Rudin-Shapiro sequence](https://en.wikipedia.org/wiki/Rudin%E2%80%93Shapiro_sequence) is a sequence of \$1\$s and \$-1\$s defined as follows: \$r\_n = (-1)^{u\_n}\$, where \$u\_n\$ is the number of occurrences of (possibly overlapping) \$11\$ in the binary representation of \$n\$.
For example, \$r... |
[Question]
[
In this challenge, your input is an integer value. Your task is to find the sum of the range of the sum of the range of n.
Examples:
```
Input -> Output
1 -> 1
2 -> 6
3 -> 21
4 -> 55
5 -> 120
6 -> 231
7 -> 406
8 -> 666
9 -> 1035
10 -> 1540
```
This challenge shoul... |
[Question]
[
Since this is a [answer-chaining](/questions/tagged/answer-chaining "show questions tagged 'answer-chaining'") challenge, you might want to sort answers by [oldest](https://codegolf.stackexchange.com/questions/207490/the-ascii-character-countdown?answertab=oldest#tab-top).
---
Your task is simple: Choo... |
[Question]
[
**Task:** Crack the scrambled code for multiplying the square root of an integer ***n*** by the square of it!
You must post a comment in the **[cops' thread](https://codegolf.stackexchange.com/questions/115036/cops-square-times-square-root)** with a link to your working source, mentioning clearly that ... |
[Question]
[
Given a non-negative number `n`, sort the digits of `n` by their first occurrence in [pi](http://www.piday.org/million/).
Input can be taken via function cli argument, or STDIN and as a string, char[] or integer. You may output via return value, exit status or STDOUT.
[Answer]
# [Python 3](https:... |
[Question]
[
In typography, a [counter](https://en.wikipedia.org/wiki/Counter_%28typography%29) is the area of a letter that is entirely or partially enclosed by a letter form or a symbol. A closed counter is a counter that is entirely enclosed by a letter form or symbol. You must write a program takes a string as ... |
[Question]
[
Obviously this challenge would be trivial with separate functions and libraries, so they aren't allowed.
Your code must conform to an ECMAscript specification (any spec will do), so no browser-specific answers.
The array must be accessible after it is instantiated.
I have an answer that I'll withhold... |
[Question]
[
### [Related](https://codegolf.stackexchange.com/questions/89621/random-golf-of-the-day-7-a-distinctly-random-character)
You are a manager at a large number factory. You want to show everyone your business is doing well, by showing randomly chosen samples. Unfortunately, your business is not doing that... |
[Question]
[

**Antiferromagnetism** is what IBM researchers used to jump from a *1 terabyte disk* to a *100 terabyte disk* in the same amount of atoms.
In materials that exhibit antiferromagnetism, the ... |
[Question]
[
Write the shortest function to convert an IP address into it's integer representation and output it as an integer.
To change an IPv4 address to it's integer representation, the following calculation is required:
* Break the IP address into it's four octets.
* `(Octet1 * 16777216) + (Octet2 * 65536) + (... |
[Question]
[
Given a string like `[[[],[[]]],[]]`, made of only commas and square brackets, your challenge is to determine whether it represents a list.
A list is either:
* `[]`, the empty list
* At least one list, joined with commas and wrapped in square brackets.
You may use any three characters instead of `[,]`.... |
[Question]
[
**Challenge**
Given two positive integers \$1 \le m \le 12\$ and \$1\le d \le 31\$, representing a month and days into the month, output the amount of days that have passed since January 1st, on a non-leap year. You can assume that the number of days passed will always be constrained by the number of d... |
[Question]
[
A ragged list is a (finite depth) list where each element is either a positive integer or a ragged list.
A ragged list is *properly tiered* if it contains either all positive integers or all properly tiered ragged lists.
For example `[1,2,3,6]` is properly tiered because it is a list of only positive i... |
[Question]
[
Your submission must take a list of numbers (in whatever list format your language supports, or using multiple function / command-line parameters) or a string of numbers separated by any character that is not `0123456789`. In one language, it must add all of them and output the sum. In another language... |
[Question]
[
# Briefing
Aliens have settled on earth and strangely enough, their alphabet is the exact same as ours. Their language is also very similar to ours with some very distinct and easy to compute differences.
# Challenge
Take a string and output the alien's language equivalent. The translation works as suc... |
[Question]
[
This is a rather easy challenge.
# Challenge
Input will contain a string (not `null` or empty) of maximum length 100. Output the number of vowels in each word of the string, separated by spaces.
# Rules
* The string will not be more than 100 characters in length.
* The string will only contain alphabet... |
[Question]
[
# Specifications
Given a number `n`, output an ASCII "meme arrow" (greater-than symbol, `>`) of size `n`.
`n` will always be a positive integer, greater than 0.
## Examples
`n = 2`
```
\
\
/
/
```
`n = 5`
```
\
\
\
\
\
/
/
/
/
/
```
# Sample code
Here is a sample program, written... |
[Question]
[
First line is made with `ceil(n/2)` elements where each element is: `<space><odd-number><space>`
Second line is made with `ceil(n/2)` elements, but each element is `/ \` only.
You may assume `n >= 0` and `n <= 10`.
### Examples
Input: 3
```
1 3
/ \/ \
```
Input: 10
```
1 3 5 7 9
/ \/ \/ \/ \/ \
... |
[Question]
[
Here is an easy-intermediate challenge for anyone interested!
# What is that?
A thing me and brother do a bit too often is this:
One of us has a problem and asks the other to explain how to do certain stuff. The other just says the following carelessly:
```
How to <verb> in <n> easy steps!
... |
[Question]
[
Who doesn't love the Pythagorean theorem \$a^2+b^2=c^2\$? Write the shortest method you can in any language that takes in value `a` and `b` and prints out `The hypotenuse of this right triangle is c`. Keep `c` to only three decimal places.
[Answer]
## APL (54)
```
'The hypotenuse of this right tri... |
[Question]
[
*Inspired by [this question](https://stackoverflow.com/questions/38991478/remove-first-encountered-elements-from-a-list) on Stackoverflow.*
---
### The task
Let's have two lists/arrays of integers: `L1` and `L2` of equal length. You need to identify in `L2` the position of first occurrence of each numb... |
[Question]
[
## Task
Provide two programs/functions `A` and `B` (not necessarily in the same language) with the following properties:
* Either program, when given its own source code as input, produces an accepting output.
* Either program, when given the *other* program's source code as input, produces a rejecting... |
[Question]
[
Given a word, treat every letter as its number in English alphabet (so `a` becomes 1, `b` becomes 2, `z` becomes 26 and so on), and check if all of them, including duplicates, are pairwise [coprime](https://en.wikipedia.org/wiki/Coprime_integers).
The input is exactly one word of lowercase English lett... |
[Question]
[
A [sign sequence](https://en.wikipedia.org/wiki/Sign_sequence) is an infinite sequence consisting entirely of \$1\$ and \$-1\$. These can be constructed a number of ways, for example:
* Alternating signs: \$1, -1, 1, -1, ...\$
* \$-1\$ for primes, \$1\$ for non-primes: \$1, -1, -1, 1, -1, 1, -1, ...\$
... |
[Question]
[
Happy New Year 2024!
2024 is a [**tetrahedral number**](https://en.wikipedia.org/wiki/Tetrahedral_number). A tetrahedral number is a number that can be represented in the form \$n(n+1)(n+2)/6\$ for some positive integer \$n\$. Or, equivalently, they are the sum of the first \$n\$ [triangular numbers](h... |
[Question]
[
Given the battery level `L` in the range `0-5`, your code should draw the following ASCII art.
When `L=0`:
```
############
# ###
# ###
# ###
############
```
When `L=1`:
```
############
### ###
### ###
### ###
############
```
When `L=2`:
```
##########... |
[Question]
[
This is the cops' thread. For the robbers' thread, go [here](https://codegolf.stackexchange.com/questions/64521/find-the-nested-source-codes-robbers).
# Introduction
For this Cops/Robbers challenge, the cops will write output-producing programs and interweave them together. It is the robber's job to pi... |
[Question]
[
# What is the *Fibonacci Rectangular Prism Sequence*?
The Fibonacci Rectangular Prism Sequence is a sequence derived from the Fibonacci sequence starting with one. The first 3 numbers of the Fibonacci sequence (starting with one) are 1, 1, and 2, so the first number of the Fibonacci Rectangular Prism S... |
[Question]
[
Inspiring myself on [a recent challenge](https://codegolf.stackexchange.com/q/200950/75323), we ought to compute a sequence that is very close to [A160242](http://oeis.org/A160242).
# Task
Your task is to generate the sequence \$ \{s\_i\}\_{i=0}^\infty \$:
`1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 1, ... |
[Question]
[
[Vyxal](https://github.com/Vyxal/Vyxal) is a golfing language that has 500+ different commands (achieved through overloads), and is a known beater of Jelly, 05AB1E and most golfing languages.
Henceforth, it seems like a good idea to share some of the tips and tricks of the industry used to get terse pr... |
[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/185483/edit).
Closed 4 years ago.
[Improve this question](/posts/185483/edit)... |
[Question]
[
## Challenge
Using data from the API [here](http://www.medalbot.com/api/v1/medals), output the names of the three countries with the most Olympic gold medals at the 2016 Rio Olympic Games (i.e. the first element of the returned list).
For example, at the time of posting (18:23 UTC+1, Monday, 15th Augus... |
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.