# All Questions

13,064 questions
Filter by
Sorted by
Tagged with
71 views

### In between fractions

Given two positive integer fractions $x$ and $y$ such that $x < y$, give the fraction $z$ with the smallest positive integer denominator such that it is between $x$ and $y$. For example ...
• 84.7k
965 views

### Find the nth Fibonacci number, where n is the mth Fibonacci number

Introduction If fib(x) calculates the xth Fibonacci number, write a program that calculates ...
• 185
80 views

### Find the Lowest Allowable Integer Which is an Optimal Even-Harmonic of the Values in a List [closed]

PROBLEM For a list of numbers, list: Find the lowest possible integer, x, which is optimally close to the whole number even-...
662 views

### Find the dimensions of a ragged list

For any ragged list its dimensions will be a list of non-negative integers defined as follows: Elements that are not a list will have dimensions $\textbf{[}\,\,\textbf{]}$. An empty list has ...
• 84.7k
170 views

### Solve the Zany car game

The Zany Car Game is a tile matching game. You are given a number of tiles, with coloured cars split into a top and bottom half. To win the game, you need to find a square arrangement of the tiles so ...
• 961
1k views

### Robbers: Smallest subset of characters required for Turing Completeness

This is the robbers' challenge. The cops' one is here. In Fewest (distinct) characters for Turing Completeness, the goal is to find the minimum number of characters which make a language Turing ...
• 16.9k
2k views

### Smallest subset of characters required for Turing Completeness

In Fewest (distinct) characters for Turing Completeness, the goal is to find the minimum number of characters which make a language Turing Complete...in other words, allow it to do any computation ...
• 16.9k
5k views

### LOOOOONG TEEEEEXT

Definition of long text Long text usually shows emphasis, for instance, loooooool or yaaaaaaaaaay. Usually the vowel is ...
• 519
2k views

### Apartment Building

Draw an "apartment" building according to the specifications below. Basic Rules Take, as input, the number of floors of the building. Return a building with that many floors meeting the ...
• 1,240
230 views

Design a function or program that, when run normally, outputs the triangular numbers. However, when any single character is deleted, the program/function should not function in the original ...
• 1,240
1 vote
181 views

### King of the Cards

King of the Cards Code available here! In this King of the Hill challenge, you must write a bot that can play Crazy Eights. This is a card game often played by children, in which the objective is to ...
• 3,224
741 views

### Count the Liberties - Advanced

Here's an advanced version of the Count the Liberties challenge. The definitions of the terms liberty and group are the same as the previous challenge, so have a look at the previous one for details, ...
• 2,121
1k views

### Alternating sums of multidimensional arrays

Given a multidimensional array, find the recursive alternating sum. An alternating sum is simply the sum of an array, where every other item (starting with the second) is negated. For example, the ...
• 16.9k
2k views

### Magic: the Gathering - Colour Sorting

Related: Deck Names Friends or Foes Paying for Spells The Magic: the Gathering card game has five colours of magical mana: white (W), blue (U), black (B), red (R), and green (G). Cards can be any of ...
• 1,859
124 views

### Graphical Hello World [closed]

In this challenge, you will create the shortest graphical program that displays exactly "Hello, world!" You will need no input. You might be asking yourself, "what does he mean by ...
2k views

### There's more than one way to skin a set

Given a set of positive integers $S$, output the set of all positive integers $n$ such that $n$ can be made by summing a subset of $S$ in more than one different way, i.e., that are ...
• 18.3k
129 views

### BitCycle Metagolf

Background BitCycle is a two-dimensional Turing-complete programming language involves moving bits around a playfield. Because I am too lazy to write BitCycle programs myself, you will be writing a ...
• 3,821
2k views
+200

### Crossing a Lily Pond

The Narrative You are a frog who is at the edge of a pond with waterlilies. You would like to cross the pond without getting wet, so you plan to jump from lily to lily. There is, however, one problem: ...
• 985
281 views

### Convert Alpha-2 to Alpha-3

The Task The task is easy: given an Alpha-2 country code, output the Alpha-3 equivalent. The input may be in any case you choose, and the output in any consistent case of your choosing. Here are the ...
• 2,487
141 views

### King of the Hill: Greed Control [duplicate]

King of the Hill: Greed Control What is Greed Control Greed control is a multiplayer round-based game in which in every round, a player bet a number inside a ...
• 519
238 views

### Write a (simplified) BitCycle interpreter

Implement a function or program that can run simplified BitCycle code. The functions you must implement are: <^>v: Change the direction of a bit to the ...
• 1,240
1k views

### Draw the Archimedean Spiral

Overview I was playing with Desmos and discovered a really cool spiral: Doing some research, I discovered that this spiral was the Archimedian spiral. Every point on the spiral is exactly $\theta$ ...
• 2,487
309 views

### center a matrix [closed]

The words "center a" probably give flashbacks to any decent HTML developer. Luckily, we are not working with divs, we are working with matrices. Given a matrix where w=h, and given a "...
• 691
218 views

### Random Pixels Image Compression

Challenge: Given an integer $n$, guaranteed to be $\geq2$ and a power of 2, we are going to draw multiply boards either side-by-side or below one another, where the first has dimensions of $n$ ...
• 103k
2k views

### Bitwise XOR of floats

This is different from Floating Point XOR, and more in the spirit of a comment by R.. GitHub STOP HELPING ICE on that challenge, but I thought of this idea independently. Generalized XOR The bitwise ...
• 303
49 views

### Is it a good chord?

Is it a good chord? Definition of a chord: We define a chord as three notes together. Definition of a ...
• 519
2k views

### Palindromic Powers

Powers We define an important power as a number that can be represented as $x^y$ where $x ≥ 2$ and $y ≥ 2$. Palindrome We define an ...
• 519
3k views

### Haplololololololology!

Haplology Haplology is a linguistic term: the omission of one occurrence of a sound or syllable that is repeated within a word, for example probly for probably. For this challenge, it means ...
• 2,651
1k views

### Storing a band matrix

Related challenge A band matrix is a matrix whose non-zero entries fall within a diagonal band, consisting of the main diagonal and zero or more diagonals on either side of it. (The main diagonal of a ...
• 31.8k
444 views

### Connecting Dots

Connecting Dots We define a type of question on the test, connecting the dots Question parameters There are two parameters. Suppose they are 5 and ...
• 519
2k views

### Matrix Meets ASCII Art

A binary matrix represents a shape in the plane. 1 means a unit square at that position. 0 means nothing. The background is 0. For example, the array ...
• 519
1k views

### Euler characteristic of a binary matrix

A binary matrix represents a shape in the plane. 1 means a unit square at that position. 0 means nothing. The background is <...
• 32.7k
2k views

### ASCII-Art n'th Root

Challenge: Given two integers $a$ and $b$, with lengths $A=length(a), B=length(b)$, output an ASCII-art of the $a^{th}$ root of $b$, including the answer rounded to $A$ amount of decimal ...
• 103k
1 vote
355 views

• 18.3k
1k views

### Is Wally there?

Inpired by recent Stand-up Maths' video. Task Wrapping a list x can be seen as inserting "line-breaks" into x every <...
• 10.7k
196 views

### Plot Slope Fields Given Differential Equation

Slope fields or direction fields, are a graphical representation of the solutions to a first-order differential equation of a scalar function. A slope field shows the slope of a differential equation ...
• 447
1k views

### Convert JSON object of directories to list of paths

Task The input consists of a JSON object, where every value is an object (eventually empty), representing a directory structure. The output must be a list of the corresponding root-to-leaf paths. ...
• 1,172
2k views

### Convert Alpha-3 to Alpha-2

I've been developing some programs involving me fetching a vector from a url using Alpha-2 country codes (such as GET /jp.svg for Japan). Except, oh no! All the ...
• 401
2k views

### Infinite Candle Sequence

I have a cake shop that specialises in birthday cakes. The cakes that I sell must have candles placed in a circle. You would probably think I can just divide 360° by the number of candles, but the ...
• 1,859
3k views

### Collatz Encoding

The Collatz Conjecture The famous Collatz Conjecture (which we will assume to be true for the challenge) defines a sequence for each natural number, and hypothesizes that every such sequence will ...
• 1,333
267 views

### Draw New Posts' Profile!

New Posts and New Sandbox Posts are chatbots that occupy CGSE's main chatroom, The Nineteenth Byte. They've been doing their jobs for almost one full year now, so I thought I'd make a challenge to ...
• 3,224