instruction stringlengths 34 53.1k |
|---|
Black Box is a board game, Your task is to reveal all clues.
What is black box
Black box is a board game with hidden atoms, Your task is given input, All atoms, reveal all clues.
I/O
Input
The atoms can be any 1-char that is not newline (Used for separator) Like this.
O....
...O.
..O..
.....
....O
Output
When the code... |
Inspired by this building (United States Air Force Academy Cadet Chapel, Colorado)
Your task is simple, given a positive integer n, output the spiked building to size n
Testcases
1
->
^
/|\
/.|.\
/..|..\
_______
2
->
^ ^
/|\/|\
/.|..|.\
/..|..|..\
__________
7
->
^ ^ ^ ^ ^ ^ ^
/|\/|\/|\/|\/... |
For the given string s, generate generate a table like below.
Input:abcd
Output:
abcd
bbcd
cccd
dddd
Input:Hello, world!
Output:
Hello, world!
eello, world!
llllo, world!
llllo, world!
ooooo, world!
,,,,,, world!
world!
wwwwwwwworld!
ooooooooorld!
rrrrrrrrrrld!
llllllllllld!
dddddddddddd!
!!!!!!!!!!!!!
Trailin... |
Background
This challenge is about the game of Go. Go is a game played on a board with a square grid N x N. You don't have to know how to play the game to do this challenge, but if you are interested, google "Tromp-Taylor rules" for a minimal and precise set of rules to play a full game.
Let's use a 4 x 4 board. As the... |
The Challenge
The challenge is simple: given an input list a and another list b, repeat a until it is longer than b.
As an example, call the repeated list ra. Then the following condition must hold true: len(b) < len(ra) <= len(b) + len(a). That is, a must not be repeated more than is required.
Sample Python Implementa... |
Sometimes in chat, if someone says something you agree with, you'll send a message with an ^, which points at the message above:
Radvylf: Cats are far superior to JavaScript
You: ^
Sometimes you'll also add some text:
Radvylf: I sure do like integers
You: I mostly agree with ^ but floats are pretty neat too
You can a... |
Output the infinite list of pairs of integers (a, b), where both \$ a > 1 \$ and \$ b > 1 \$, ordered by the value of \$ a^b \$. When there are multiple pairs where \$ a^b \$ is equal, they should be ordered lexicographically.
For example, \$ 2^4 = 4^2 = 16 \$, but (2, 4) should come before (4, 2), because it is lexico... |
Bounty
One of the convincing conjectures, by Loopy Walt is,
maxlib(n) = 0, if n = 1
2, if n = 2
6, if n = 3
(2n - 1)⌊n / 3⌋, if n % 3 = 0
(2n - 1)⌊n / 3⌋ + n, if n % 3 = 2
2n⌊n / 3⌋ + 1, otherwise
Loopy Walt's post below explains how this conjecture is derive... |
Given an unordered list of musical pitches, write the shortest program/function (scored in bytes) to sort the list from lowest pitch to highest.
Pitches will be given in scientific pitch notation, consisting of a tone name followed by an octave number. Here, the tone name will be a single letter A–G, possibly followed ... |
Given a string, determine if it is an int, a float or neither.
Examples
123 - int
62727.0033 - float
644c.33 - neither
Your code should output a different value depending on which it is. For example it could return "i" for int, "f" for float and "n" for neither.
Details
The following are floats:
1.00 -0.0 1.0
The fo... |
In this challenge you will take two lists as input and you will zip them. The zip can be defined with this recursive expression:
\$
\mathrm{zip}(a,b) = \begin{cases}
\left[\,\,\right] & a = \left[\,\,\right] \\
[a_0]\mid\mid\mathrm{zip}(b, t) & a = [a_0] \mid\mid t
\end{cases}
\$
or this Haskell program if you would l... |
Given an array of integers as input(including negative integers), find all (can include duplicates) permutations that do not have the same number next to each other, then print them all out.
If no permutations were found, print Nothing or return an empty list or any consistent output indicating that none were found.
No... |
Task
Given a positive integer n, output the joined compound of circles
The circles are of square of size n+2 but removing the corner edges and the middle, before finally overlapping n times of itself
E.g.
2
->
####
####
####
####
->
##
# #
# #
##
->
## ##
# # #
# # #
## ##
Testcases
1
->
#
# #
#
2
->
... |
Given a ragged list, e.g.
[[4, 7], [5, 3, [], [6, [2]]]]
Your challenge is to sort only the numbers in it. For example, with the above, the result would be
[[2, 3], [4, 5, [], [6, [7]]]]
The shape of the output should remain the same, only the numeric contents should change.
This is code-golf, shortest code wins!
All... |
My third word search related challenge in a row. :)
Challenge:
Brief explanation of what a word search is:
In a word search you'll be given a grid of letters and a list of words. The idea is to cross off the words from the list in the grid. The words can be in eight different directions: horizontally from left-to-right... |
Given a positive integer as input, output that integer, but with its bits rotated two times to the right. Also, think of the number as a donut of bits, eg. 21 -> (10101). If all of the bits suddenly decided to move to the right, they would wrap around. eg. rRot(21) -> (11010) = 26. Do what i explained 2 times (at the s... |
Task
Given an \$m\times n\$ binary ascii "photo", return the negative of the photo
Example:
#
# #
# #
# #
#
->
## ##
# # #
###
# # #
## ##
General rules:
This is code-golf, so the shortest answer in bytes wins
Standard rules and default I/O rules apply
Your output characters must be the same as your in... |
Note: This challenge was inspired by Joe Z's many excellent questions surrounding NAND golfing.
Description
Your goal in this challenge, should you choose to accept it, is to implement a very simple ALU using just NAND gates. The ALU can only perform the the following four operations:
00, meaning increment (wrapping a... |
Given a ragged list of positive integers return a full cycle of recursive rotations starting with the unchanged input and ending with the state immediately before revisiting the initial state.
Examples:
[[2,3],4,5,5] -> [[2,3],4,5,5] , [4,5,5,[3,2]] , [5,5,[2,3],4] , [5,[3,2],4,5]
[1,10,[2,2,4],6,[[5,6],7],1] -> [1,10... |
Input a decimal number and round it to an integer, randomly rounding up or down with a probability based on its fractional part, so the expected value of the output equals to the input value.
If input \$x\$ is an integer, the program should output it as is. If \$x\$ is not an integer, the program has a \$x-\left\lfloo... |
A long period prime is a prime number \$p\$ such that decimal expansion of \$1/p\$ has period of length \$(p-1)\$. Your task is to output this number sequence. For purposes of this challenge we will consider only odd primes.
Period of a decimal expansion of a rational number is the smallest period \$k\$ that makes the ... |
You are given a string of unknown length that contains a varied amount of (, {, [ and their respective closing parentheses (in this context all referred to as brackets).
With one exception, all the brackets are all balanced, meaning an opening one has a corresponding closing one somewhere afterwards in the string.
The ... |
As you probably know, there is a war going on in Ukraine. I noticed that it seems nobody has posted a Ukrainian flag challenge yet, so I thought I'd do it myself in support of Ukraine.
The Challenge
Here is the flag:
The flag is divided horizontally across the middle into two equally sized stripes.
Stripe colors: (0,... |
What?
Let's say I have this graph:
1
\
\
2 3
\ /
\ /
4
I can represent it in 2 ways:
A list of connected vertices. [[1,3],[2,4],[3,4]]
A boolean matrix which shows where edges are:
c |1 2 3 4
--|-------
1 |0 0 1 0
2 |0 0 0 1
3 |1 0 0 1
4 |0 1 1 0
----- or -----
[[0,0,1,0],[0,0,0,1],[1,0,0,1],... |
Input: a whole positive number greater than 4
Output: A whole positive number that describes the highest possible period an oscillator could have inside a square space of size (input)x(input) in a "life" grid that follows the rules of Conway's Game of Life. The oscillator never leaves this area throughout its cycles. I... |
Your task is to output a square sandbox of size n+2 with / characters in the corners and | for the sides, and - for the top, with n**2 layers of sand (.) overflowing out of the sandbox of width n+2
Testcases
1
->
/-/
|.|
/./
...
2
->
/--/
|..|
|..|
/../
....
....
....
....
3
->
/---/
|...|
|...|
|...|
/.../
.....
...... |
It's Nowruz and you want to set up a Haft-Sin table by words. This means finding seven words that start with letter s.
The Challenge
Write a program which its input is a list of words separated by space, and output at most first 7 words which starts by letter s. If the s is before letter h it doesn't count because it w... |
Minecraft has a fairly unique lighting system. Each block's light value is either one less than the brightest one surrounding it, or it is a light source itself. Your task is to write a method that takes in a 2D array of light source values, and then returns a 2D array with spread out lighting, where 0 is the minimum v... |
Your task is to output a spaceship of size n with shooters/guns and n bullets of character - (with spaces in between each bullet) for each gun
Rules
If n is odd, you must output the guns every even numbered row
If n is even, you must output the guns every odd numbered row
All rows with guns must have n+1 # character... |
Introduction:
In my recent Strikethrough the Word Search List challenge I mentioned the following:
When I do the word-search puzzles, I (almost) always go over the words in order, and strike them through one by one.
In some cases I do them in reversed order as a change of pace, although that doesn't matter too much r... |
Take an input, and convert it from Two's Complement notation (binary where the first bit is negated, but the rest are taken as normal) into an integer (in a somewhat standard output form). Input can be as a string, a list of digits, a number, or pretty much any other format which is recognizably Two's Complement. Leadi... |
kolmogorov-complexity is one of the tags on this site, representing challenges that test how much code is needed to output a given fixed result (usually a piece of text). The info page for this tag lists the string 4c1j5b2p0cv4w1x8rx2y39umgw5q85s7uraqbjfd as an example of a string with a high Kolmogorov complexity, sta... |
You want to send an ASCII letter to someone, but you need an envelope to put it in. Your task is to output an envelope given a size as input.
Rules:
Given positive integer input i, your envelope will be i characters tall (not counting the top row), and i*2 characters wide (not counting the side columns). In other word... |
Given two integers, compute the two numbers that come from the blending the bits of the binary numbers of equal length(same number of digits, a number with less digits has zeros added), one after the other, like such:
2 1
10 01
1 0
1001
0 1
0110
some examples:
Input
Binary
Conversion
Output
... |
There are times when a large number of people need to choose something. They all want to get the stuff they choose, obviously, but it's impossible to please everyone that way, so a usual compromise is to give people three choices and try to make sure that everyone gets one of their choices.
For instance, consider three... |
4, 32, 317, 3163, 31623, 316228, 3162278, 31622777, 316227767, 3162277661, 31622776602, 316227766017, 3162277660169, 31622776601684, 316227766016838, 3162277660168380, 31622776601683794, 316227766016837934, 3162277660168379332, 31622776601683793320, 316227766016837933200, 3162277660168379331999, 31622776601683793319989... |
In Super Auto Pets, players build teams of animals that face off in battles to the death unconsciousness. Each animal has an Attack and Health value, and combat occurs in iterations of the following process:
The front animals of each team deal damage to each other equal to their Attack at the same time.
Both animals ... |
This is OEIS sequence A055397.
In Conway's Game of life, a still life is a pattern that does not change over time. We can see from the rules of Conway's Game of life that, a pattern is a still life if and only if:
every living cell has exactly two or three living neighbors,
none of the dead cells have three living nei... |
Input
An \$m\$ by \$n\$ binary matrix, with \$m\$ and \$n\$ both at least 2.
Think of the ones as gobs of melted cheese, which stretch as we expand the matrix horizontally and vertically.
More precisely...
Output
A \$2m-1\$ by \$2n-1\$ binary matrix, constructed as follows...
First insert rows of zeros between the rows... |
Inspired by @AviFS.
Given a string containing brackets, e.g.
[xyz]]abc[[def]hij[
You can parse through it with a stack of brackets. When you find an open bracket, push a value to the stack, when you find a close bracket, pop from the stack. If you make these values indices, you know where you need to remove brackets.
... |
The sci-fi shooter Destiny 2 contains guns which have the ability to regenerate ammunition directly into the magazine if, and only if x (precision) shots are landed (in a fixed amount of time), returning y bullets to the magazine. For example, the perk (ability) "Triple Tap" will return 1 bullet to the magazine if 3 pr... |
(l, r) defines a line whose left end is at l and the right end is at r, on a 1-dimensional space.
Given 2 lines b = (0, bz) and f = (i, i + fz), v = (l, r) is the overlapping part of these lines. When b and f do not overlap (when v cannot have a positive length), v = (0, 0).
(input) -> (output)
bz, fz, i -> l, r
The... |
One of your acquaintances has a hobby of making make-shift electrical gadgets using various types of batteries. However, since they're thrifty, they want to use as few batteries as possible for their projects. This challenge uses several types of batteries; your job is to output the fewest number of batteries that will... |
+-= is a language created by Esolangs user Anonymous in 2017.The language consists of only three commands:
+ increases the accumulator by one.
- decreases the accumulator by one.
= outputs the accumulator and a newline.
Rules
This is code-golf, all usual golfing rules apply.
Standard rules apply.
You may assume inpu... |
For a 2 dimensional array we will call the elements in either the first row or the last column the "J-Bracket" of the array. For example in the following array elements in the J-bracket are highlighted:
\$
\begin{bmatrix}
\color{red}{\underline 1} & \color{red}{\underline 2} & \color{red}{\underline 4} & \color{red}{\... |
Cops' Challenge
Robbers' challenge here.
It has now been four days since the challenge was posted so all new answers should be marked as non-competing in the title. These answers can still be cracked by robbers but will not go towards their total, and cannot win this challenge.
In this cops-and-robbers challenge, you... |
Robbers' Challenge
Read the cops' challenge first.
In this cops-and-robbers challenge, you (the robbers) must find the correct string of characters, which, when added into the cop's code, will make it produce the correct (case-sensitive) output (except that there may also be an extra trailing newline at the end).
The n... |
Fennel is a lispy language which compiles to Lua.
From its page:
Fennel is a programming language that brings together the speed, simplicity, and reach of Lua with the flexibility of a lisp syntax and macro system.
I am looking for general tips for golfing in this language. Tips should be specific to Fennel, "Remove ... |
For a 2 dimensional array we will define the elements in either the first row or the last column to be the largest "J-Bracket" of the array. For example in the following array elements in the J-bracket are highlighted:
\$
\begin{bmatrix}
\color{red}{\underline 1} & \color{red}{\underline 2} & \color{red}{\underline 4}... |
It's laundry day, and you have lots of clothes that need to be washed. Wanting to have as much time left over for code golf as possible, you hope to optimize how quickly you wash and dry them all.
You have three types of appliances:
Washing machines: Take dirty clothes and turn them into wet clothes
Dryers: Take wet c... |
It's 2050, and people have decided to write numbers in a new way. They want less to memorize, and number to be able to be written quicker.
For every place value(ones, tens, hundreds, etc.) the number is written with the number in that place, a hyphen, and the place value name. "zero" and it's place value does not need ... |
Seeing that the current language for Learn You a Lang for Great Good is Piet, and that we don't seem to have a tips page for Piet yet, I decided to make one.
Piet is a stack-based esoteric programming language in which the programs are meant to resemble abstract drawings.
What are some general tips for golfing in Piet?... |
Given a list of the integers from \$1\$ to some \$n\$, give the minimum number of adjacent swaps required to put the list in ascending order.
You will receive a list as input and should output a non-negative integer. You may if you wish choose to expect a list of the integers from \$0\$ to \$n\$ instead.
This is code-... |
Description
The Caesar cipher is a cipher, where every letter in the alphabet will be rotated by a secret number.
If the rotation is \$7\$, then a -> h, g -> n, v -> c and z -> g.
Today, we're playing Caesar's Cipher with ASCII chars, (0-127 inclusive).
So, with rotation \$7\$, b -> i, Z -> a, x -> DEL (127),
But, even... |
We are probably all used to the English alphabetical order:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
When we compare words in English for the sake of alphabetization we first compare the first letter, whichever word has the later first letter comes later. If they are the same we check the second letter and... |
Imagine throwing a rock into a pond. You get to see perfect circles of ripples spreading out over the pond, bouncing off of each other. Of course, nothing can be as serene as that in coding, but, we can try!
Given a point on a 2D array (x, y) and the dimensions of a 2D array/pond (w, h), and a "frame" count, f, return ... |
Given some input array a = [a1, a2, ..., an] and a positive integer k, shuffle the input array a such that no entry is farther than k from its initial position.
Example
Given the array [1, 2, 3, 4, 5, 6] and k = 1, this means the entry 3 can be at following positions:
[*, 3, *, *, * ,*]
[*, *, 3, *, *, *] (original ... |
The brilliant engineers at <enter company you love to hate> have struck again. This time they've "revolutionised" the generation of random permutations. "Every great invention is simple" they say and their magical new algorithm is as follows:
Start with a list 1,2,3,...,n of numbers to permute.
For each element x in t... |
Curry is the Language of the Month this month and some users are starting to get into it, so let's get some tips together.
Haskell and Curry are similar in a lot of ways and a lot of tips for Haskell work well in Curry and vice versa. So I'd like in this question to gather tips for code-golf in Curry, that would be use... |
Sieve of Eratosthenes is a method for finding prime numbers:
take the sequence of all positive integer numbers starting from 2 then for each remaining number drop all its multiples.
2 3 x 5 x 7 x 9 x 11 x 13 x 15 x 17 x ...
2 3 _ 5 _ 7 _ x _ 11 _ 13 _ x _ 17 x ...
Task
Given a number \$n \ge 2\$, find the minimum amo... |
Problem
John bought 5 apples. You are given the weights of every group of four apples, and must then find the weights of the apples themselves.
For example, if all apples without the first one weigh 798 g, without the second - 794 g, without the third - 813 g, without the fourth - 806 g, and without the fifth - 789 g, ... |
Recently a friend of mine posed the following:
What subset of the integers satisfies the condition if distinct a and b are in the subset, their average is not in the subset? I know the set of non-0 squares satisfies the condition, but I wonder if there exists a more... dense set that satisfies the condition.
(It turn... |
Given a string, like potatocarrot, break it into the smallest number of substrings possible. These substrings can consist either be a single character, or one of a list of words passed as input. For example, if [carrot, potato] was the input, the optimal way to break the string up would be [potato][carrot]. If the list... |
Given a base type T, this can be augmented with * or [], each meaning pointer and array. For example, []*T means "array of pointer to T" and *[]T means "pointer to array of T".
Let's call * and [] type modifiers. C has a way of ordering these modifiers tied to the evaluation order. []*T in C-style becomes T *[], and *[... |
Two or more positive integers are said to be "friendly" if they have the same "abundancy". The abundancy of an positive integer \$n\$ is defined as $$\frac {\sigma(n)} n,$$ where \$\sigma(n)\$ is the sum of \$n\$'s divsors. For example, the abundancy of \$30\$ is \$\frac {12} 5\$ as
$$\frac {\sigma(30)} {30} = \frac {1... |
Introduction:
Apparently I keep coming up with word search related challenges lately. :)
When I do the word search in the Dutch news paper, some words are very easy to find because they contain letters that aren't too common in Dutch words, like x or q. So although I usually look for the first letter or prefix of a wor... |
Background
Piet is an esoteric stack-based programming language in which programs are images meant to resemble abstract paintings.
To keep the challenge from being unnecessarily complex, you will not have to consider most of the colors present in Piet, which determine what instructions are executed; instead, each type ... |
Please help me automate my discrete mathematics homework. Given a valid propositional formula, check if it is an instance of one of Łukasiewicz's axioms. Here's how it works.
A term can be defined inductively as follows:
Single lower-case letters of the Latin alphabet (a, b, c, etcetera) are terms.
Given a term ϕ, ¬ϕ ... |
A polyiamond of size \$n\$ is a contiguous shape formed by joining \$n\$ equilateral triangles side by side.
Your output should consist of two distinct characters, plus whitespace as necessary (▲ and ▼ work great!). Trailing whitespace is acceptable. You may use any other characters - but you may count ▲▼ as 1 byte e... |
Given a string consisting of ()[]{}, print the paired brackets in the same order as they appear in the string.
Any opening bracket ([{ can be paired with any closing bracket )]}.
For example:
({()[}]]
returns:
(], {], (), [}
Rules
A string consisting of ()[]{} should be received as the input
The bracket-pairs should ... |
Given a pattern and a ragged list of positive integers, your task is to decide whether the pattern matches the ragged list.
The pattern is also represented by a ragged list. But in addition to positive integers, it may contain a wildcard value.
Here is the rule for matching:
A positive integer matches the same positiv... |
Let's say we have a 2-D list, like the following one:
\$
\begin{bmatrix}
\color{red}{1} & \color{red}{2} & \color{red}{3} & \color{red}{4} \\
\color{blue}{5} & \color{blue}{6} & \color{blue}{7} & \color{red}{8} \\
\color{green}{9} & \color{green}{10} & \color{blue}{11} & \color{red}{12}
\end{bmatrix}
\$
Notice how the ... |
Your task is to make a program or function that takes a nonnegative integer (or a different convenient format to represent it) that represents an angle measure in degrees from 0 to 180 (inclusive) as input and outputs every possible time (in hours and minutes; no seconds) on an analog clock where the measure of the sma... |
The Matoran Alphabet is the alphabet used by many of the characters in the Bionicle universe.
Your challenge is to create a program or function that takes a string as input and creates an image of the input written in the Matoran alphabet.
The input will only consist of uppercase letters (A-Z), numbers (0-9), and spac... |
Or Fix American Kennel Club's database
As covered by the recent video by Matt Parker, the American Kennel Club permits thirty-seven (37) dogs of each breed to be assigned the same name (source), because of a database restriction for Roman numeral length.
Given an integer, your task is to output the length of its Roman ... |
This is a quine challenge related to Write the shortest self-identifying program (a quine variant)
Write a function or a full program that compares lexicographically its source code and input, that is, output three distinct values of your choice telling if input / source code is Bigger, Equal or Less than source code /... |
For our purposes, a trend is a contiguous subsequence of an array that falls into one of three categories:
increasing, e.g. [1,2,3,10,239]
decreasing, e.g. [8,5,0,-3,-50]
stable, e.g. [7,7,7,7]
Note that [1,1,2,3] is not a valid trend. It can be broken up into a stable trend [1,1] and an increasing trend [1,2,3]. In ... |
makina is a cell-based esolang composed of automata which move around a grid. These automata follow paths of instructions that direct their movement. Your task is to, given a makina program using only the below instructions (so a subset of normal makina) as input, output two distinct values depending on whether or not ... |
\$ 1089 \$ is a very special number. To prove why, select any 3-digit number whose first and last digits differ by at least 2. Then, reverse the digits, and take the difference of these two numbers. Reverse the digits once more, and add these two numbers together. You will get \$ 1089 \$. The magic is left as an exerci... |
CLOSED to competing entries
New bots are welcome but are not part of the main competition and probably won't be officially tested.
You stand on a dusty stretch of code, watching the other programs stare at you. Will they shoot? How much ammunition do they have left? All you know is that you want to be the last one stan... |
A binary eye is an odd set of digits, with all of its digits except the center one set to 1 or 0, and the center one set to the opposite of the others. Thus, there are two binary eyes for a given odd number of digits:
x
eyes
1
1,0
3
101,010
5
11011,00100
7
1110111,0001000
9
111101111,000010000
Make ... |
Given an integral polynomial \$p\$, determine if \$p\$ is a square of another integral polynomial.
An integral polynomial is a polynomial with only integers as coefficients.
For example, \$x^2+2x+1\$ should gives truthy, because \$x^2+2x+1 = (x+1)^2\$.
On the other hand, \$2x^2+4x+2\$ should gives falsy: \$2x^2+4x+2 = ... |
Objective
Given a positive integer, spell it out in the conlang I made.
Specification
Let \$n\$ be the inputted integer. \$n\$ shall be spelled out in the following specification. The entire spelling is case sensitive.
With the decimal expansion of \$n\$, let d be the least significant nonzero digit of \$n\$.
First, d ... |
Given an input string and a wrapping string, find the location of the first input string char in the wrapping string and replace it with the wrapping string char 1 step to the right of that, find the second char in the wrapping string and replace it with the char 2 steps to the right, find the third and replace it with... |
This challenge has been divided into parts.
Your goal is to convert a sentence into a form of 'short-hand'
For Part 1 these are the rules
Take in 1 word
Remove all vowels(a,e,i,o,u), except the ones at the beginning and the end
If a letter is repeated more than once consecutively, reduce it to only one (e.g. Hello -> ... |
Given an expression like 4 / 2 + 3, determine whether the expression has the same value in Python 2 and Python 3. Recall that in Python 2 division rounds down (so that 5 / 2 -> 2), whereas in Python 3 division returns a float (so that 5 / 2 -> 2.5).
For simplicity's sake, we will only consider expressions of the form:
... |
Part 1 of the challenge revolved around converting the letters into specific unicode characters.
Lore
In this part we receive the output from the function made in Part 1, which now has to be arranged in an artistic manner.
Aim
Take 1 word as input which has already undergone transformation in the function made in Part ... |
Starting with 1, output the sequence of integers which cannot be represented as the sum of powers of earlier terms. Each previous term can be used at most once, and the exponents must be non-negative integers.
This sequence starts:
1, 2, 6, 12, 25, 85, 194, 590, 1695, 4879, 19077, 83994, 167988
For example, after 1 an... |
Input variables:
(Names are just examples, they don't need to be named like this)
GrandTotal - integer to divide
SplitCount - number of output integers required
UpperLimit - highest valid value for any one output integer
LowerLimit - lowest valid value for any one output integer
Valid Output:
Outout must be a random ... |
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 honor their contributions!
The challenge is simple: Draw the profile picture of either New Posts (NP) or New Sandbox Posts ... |
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 ultimately reach 1. For a given starting number N, the following rules are repeatedly applied until the result is 1:
While N... |
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 machine for placing candles is quite unique; it uses a list of numbers representing positions of candles, placing them one-... |
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 country data on my computer uses Alpha-3! That just won't do...The task is simple: Take an Alpha-3 country code (e.g. UKR) and return its Alpha-2 equivalent (... |
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.
Inspired by this comment on StackOverflow.
Input specifications
You can assume that that the input always contains a JSON ... |
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 at certain vertical and horizontal intervals on the cartesian plane, and can be used to determine the approximate tangen... |
Inpired by recent Stand-up Maths' video.
Task
Wrapping a list x can be seen as inserting "line-breaks" into x every n-th element, or forming a matrix from x with n columns (feeding rows first). To be perfectly rigorous in the definition of x wrapped into a matrix, we can pad the last row with 0s.
Given a list x of posi... |
Given two sets of strings, \$ D \$ and \$ R \$, find the shortest string which contains every string in \$ D \$, but contains none of the strings in \$ R \$.
There are almost always multiple possible outputs; you should output at least one of them, but you can output more.
You can assume this is possible with the input... |
Your task, should you choose to accept it, is to take two input values \$a\$ and \$b\$,
where \$a\$ and \$b\$ are in the set \$\{T, U, F\}\$, and compute and output their logical conjunction in a three-valued logic system.
A three valued logical conjunction is this transformation:
a
b
output
U
U
U
U
F
F
F
... |
You have a line with two endpoints a and b (0 ≤ a < b) on a 1D space. When a or b has a fractional value, you want to round it to an integer.
One way to do this is to round a and b each to its nearest integer, but this has a problem that the length of the rounded range (L) can vary while b - a stays the same. For examp... |
Given a string and the characters used to encode it, you need to compress the string by only using as many bits as each character needs. You will return the character codes for each character needed to create a compressed string.
For example, given the string "the fox" and the encoder characters " abcdefghijklmnopqrstu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.