instruction stringlengths 34 53.1k |
|---|
Time for you to implement my new stack based language! It's called StackyMath. This will be a stack based language with 8 operations on the stack and ways to add numbers to the stack.
List of operations:
/: Division. Performed on the top 2 numbers of the stack. Pushes the result back on the stack.
*: Multiplication. P... |
Write a piece of code that is executable in at least three different languages. The code must output the integer 1 in language number one, 2 in language number two, 3 in language number three etc.
Rules:
The output must be only the integer, but trailing newlines are OK.
The code can't take input of any kind
Different... |
Introduction
The International System of Units is a system of measuring all around the world, except for a few countries including the US. The SI system (or metric system) is based on powers of ten, listed below (note that this is an incomplete table):
femto(f) pico(p) nano(n) micro(μ) milli(m) centi(c) (base unit) hec... |
Background
Alice and Bob are creating a golfing language to win every single PPCG challenge.
Alice wants to make a two-dimensional language, like ><>, but Bob prefers a prefix-infix syntax like in J.
As a compromise, they decide to create a two-dimensional prefix-infix language.
The parser is a pain to write, and they ... |
Your task is to analyse the input and output the formula for the n-th term if it is an arithmetic sequence, otherwise it should print "NAAP".
Input
Input (from STDIN) will consist of few numbers, between 4 to 10 numbers where each number will be in the range between -1000 and 1000 inclusive, separated by a delimiter (... |
The idea of this challenge is simple: create a bot to play the card game Euchre.
For those of you who don't already know them, I've written out the rules to Euchre here as they pertain to this challenge.
I recommend using python or something similar, but the only real restriction is that it has to be compatible with th... |
Challenge: make a program that outputs a MD5 hash of its source code.
You should not use tricks that would be considered cheating in a quine sense (discussed here).
Using built-in functions and external libraries is allowed. The program should be a full program (not a function/subroutine). Code-golf: shortest solution ... |
Challenge
¡We're going to give exclamation and question marks inverted buddies!
Given a body of text containing sentences ending in ., ?, or !, prepend inverted question marks, ¿, to interrogative sentences (sentences ending in ?) and inverted exclamation marks, ¡, to exclamatory (sentences ending in !). Sentences endi... |
Inspired by https://puzzling.stackexchange.com/questions/24334/to-catch-a-thief
You are given an n by n (n itself is optional input) grid filled with 0s and 1s (or any other character of your choice). You aim is to make every cell the same (either 0 or 1). You can make a series of moves as defined below (note dissimila... |
The objective of this challenge is to write a program to convert an inputed string of what can be assumed as containing only letters and numbers from as many bases between 2 and 36 as possible, and find the base 10 sum of the results.
The input string will be converted to all the bases in which the number would be defi... |
Inspired by this SO question
As input you will be given a non-empty list of integers, where the first value is guaranteed to be non-zero. To construct the output, walk from the start of the list, outputting each non-zero value along the way. When you encounter a zero, instead repeat the value you most recently added to... |
A numeronym (also known as a "numerical contraction") is when a word is shortened using numbers. A common contraction method is to use the length of the replaced substring to replace all but the first and last characters. For example, use i18n instead of internationalization, or L10n instead of localization. (The L is ... |
Introduction
When solving a rubiks cube, one often write down the times like this
11.91, (11.28), (12.32)
This is called a average of 3, while a average of 5 looks like this
13.36, (11.89), 12.31, (16.44), 12.26
Note how the worst and best times have parenthesis around them. When calculating the average of 5 these ti... |
Elixir is a relatively new functional language, which I've taken a deep interest in. I'd like to get general tips about golfing in Elixir and learn techniques that can be applied to code-golf problems that are somewhat specific to Elixir in general.
Based on so many similar questions about Python, Ruby, Javascript, et... |
Italian zipcodes are 5-digit numbers. Each number is linked to a province. There are 4610 zipcodes and 110 provinces (as of 2015) in Italy.
Given the list of zipcodes and the related province (in this file - Gist here) write a function (any language would be fine) that, accepting in input an Italian zipcode, writes out... |
Given a number N, the challenge is to get the sum of the pyramid of N primes. To clarify things, here is an example:
Input: 4
We will list the first 4 primes, and then compute the sum of them. After that, we will compute the sums of the sums, and so on:
2
> 5
3 > 13
> 8 > 33
5 > 20
> 12
... |
Write a function that takes two parameters: a positive integer n and a list of words.
Given a cube of n-by-n-by-n units, assign a random letter (A-Z) to each surface unit. (For a 3x3x3 cube, there would be 9 surface units on each face.)
Then determine whether it's possible for an ant walking along the surface (with th... |
Following the fine tradition of questions such as Find the largest prime whose length, sum and product is prime , this is a variant on a largest prime challenge.
Input
Your code should not take any input.
Definition
We say a prime p is good if p-1 has exactly 2 distinct prime factors.
Output
Your code should output the... |
A regular polygon is a polygon that is equiangular (all angles are equal in measure) and equilateral (all sides have the same length).
Your job is to find out if a given polygon is regular or not.
Specs
You will be given a list of Cartesian coordinate 2-tuples which describe the polygon's vertices.
The points will alw... |
Write a program or function that takes in a nonempty list of integers in any reasonable convenient format such as 4, 0, -1, -6, 2 or [4 0 -1 -6 2].
Print or return a string that depicts the list as an ASCII art forest where each number becomes a tree of proportional height. Each tree takes up four columns of text in t... |
Programming Puzzles & Code Golf has opened a taco truck! The word is out and now users from all over the Stack Exchange network are coming to try our tasty, authentic ASCII tacos. We need your help to ensure that everyone gets their orders in a timely manner. There isn't a whole lot of room inside food trucks, so you'l... |
Pythagoras had his leg blown up in the war. It had to be amputated, and though he nearly died, he pulled through and made a full recovery. Now, after a year of walking with crutches, he gets the privilege of getting a prosthetic leg! Thing is, though, there are several that fit, but which ones?
The Task
Given a positiv... |
Take a look at the sevens multiplication table from 7×0 to 7×9:
0, 7, 14, 21, 28, 35, 42, 49, 56, 63
If we just look at the digits in the one's place we get a permutation of the digits 0 through 9:
0, 7, 4, 1, 8, 5, 2, 9, 6, 3
Consider taking some positive decimal integer N and replacing each digit D in N with the th... |
This challenge is based off a riddle I read in some book a while ago, which I found again here. It is about bullets fired from a gun once per second at varying speeds that travel in a straight line forever. When one bullet hits another, both are destroyed completely. (Feel free to replace all instances of "bullet" with... |
Suppose one day you are digging through your big box of unused computer cords and adapters (USB to USB mini, VGA to DVI, etc.). There are tangled cords everywhere making quite a mess, and you wonder if you could simplify things by attaching all the cords together in one long strand, and then just rolling it up.
The que... |
Hilbert numbers are defined as positive integers of the form 4n + 1 for n >= 0. The first few Hilbert numbers are:
1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61, 65, 69, 73, 77, 81, 85, 89, 93, 97
The Hilbert number sequence is given by OEIS sequence A016813.
A related number sequence, the Hilbert primes... |
Specification
This challenge is simple to state: your input is a non-empty array of nonnegative integers, and your task is to partition it into as few increasing subsequences as possible.
More formally, if the input array is A, then the output is an array of arrays B such that:
Each arrays in B form a partition of A i... |
Given an input n where 3 <= n <= 25, perform the following steps, starting with a single n-sided die (faces in the range [1, n], inclusive):
Print the result of rolling the current n-sided dice in play, in the form kdn: X (where X is the result and k is the number of dice in play).
If X is greater than or equal to n/2... |
Find the Intersection of 2 Sets in Unioned Interval Notation
Given two sets of real numbers described as the union of intervals, output a description of the intersection of these two sets as a union of the same type of interval.
The input sets will always consist of unions of intervals such that each interval begins a... |
The game of Sevens is played as follows: n players sit in a circle, and start counting up from 1, passing to the left (or from player A to player B).
When a number p that has a 7 in it OR is divisible by 7 is reached, then the player who spoke the number p-1, after the next player says p, must say p+1 and the order of ... |
Sometimes when writing brainfuck code, you feel the need to make it longer than needed to encourage debugging. You could do it by just plopping a >< in there, but what fun is that? You'll need something longer and less NOPey to confuse anybody reading your code.
Quick introduction to Brainfuck
Brainfuck is an esoteric... |
The Dal Segno and Da Capo are two very commonly used musical terms. They mean "from the sign" () and "from the beginning" respectively.
There is also the idea of the coda (), which is the very end of a piece of music. It's what's played after the "main section" of the piece.
A D.S. al coda (Dal Segno al coda), for exam... |
Write a programs that reads the file Smart.txt & outputs the order from Most Smart to Least smart.
--Smart.txt
Sam John
John Michael
Taylor Sam
In the above text file the person on the left is smarter than the person on the right. So we have to finally print the output as follows:
Taylor Sam John Michael
There can be... |
I like the concept of 0815, except the interpreter on the creator's website returns an Error 404. So I decided to ask you all to help!
The Basics
0815 is based around three (3) registers and a queue. The registers are named X, Y, and Z, with X being write-only, Z being read-only, and Y being a "helper" register that ca... |
https://en.wikipedia.org/wiki/Connect_Four
Does anyone remember the 2 player game connect 4? For those who don't it was a 6x7 board that stands vertical on a surface. The goal of connect 4 is to, well connect 4! The connection is counted if it is horizontal, diagonal, or vertical. You place your pieces on the board by ... |
The Rules
Each submission must be a full program.
The program must take input as two comma-separated dates in the form YYYY-MM-DD, and print the number of days that has passed since the second date to STDOUT as if today was the first date (if the second date would be in the future, output a negative number) plus an o... |
This little piggy went to market, this little piggy wrote some code...
Ah wait, we're not talking about that bacon, we're talking about Sir Francis Bacon! Specifically, the cipher Bacon devised in the late 1500s, as a method of hiding a message within another message, a method of steganography.
The cipher works by conc... |
Innovation is a card game where players battle through the ages, from prehistory to modern times, in an attempt to earn achievements faster than their opponents.
Each card in Innovation is unique, and provides a player with a number of icons. If we treat each card as a 2x3 grid, then three of the four slots on the left... |
Background
A fractal sequence is an integer sequences where you can remove the first occurrence of every integer and end up with the same sequence as before.
A very simple such sequence is called Kimberling's paraphrases. You start with the positive natural numbers:
1, 2, 3, 4, 5, 6, 7, 8, 9, ...
Then you riffle in so... |
Let's get back to basics!
Your code, a complete program or function, must convert the official Unicode name of a printable Basic Latin character into the corresponding character. For example, for the input LOW LINE your code must output _.
You only need to take a single character name as input.
You cannot use any pre... |
(Literally: "Does this follow/realize the gismu-form?")
Premise
The language Lojban is a constructed language, meaning in part that all of its words have been created rather than allowed to develop naturally. The semantic base of Lojban are its gismu, or root words, which were synthesized by combining roots from widely... |
This question was inspired by this HNQ.
About the series
This question is now part of a series about the AGM method. This first post in the series will be about actually calculating the AGM. You may treat this like any other code golf challenge, and answer it without worrying about the series at all. However, there is ... |
The challenge below requires you to be familiar with formal parser theory. If you don't know what the question is asking because you don't know what the terms mean, context-free grammars and first/follow sets are covered in a lot of university courses.
I can recommend this Stanford course, in particular handouts 08 and... |
The Catalan numbers (OEIS) are a sequence of natural numbers often appearing in combinatorics.
The nth Catalan number is the number of Dyck words (balanced strings of parenthesis or brackets such as [[][]]; formally defined as a string using two characters a and b such that any substring starting from the beginning has... |
sheesh, is this really the 4th? For all you oldcomers, the core challenge is the same, but we are using Java instead of a custom language. Here are the past three CodeBot challenges, in case you are interested.
The goal of CodeBots is to make your bot as viral as possible. Each bot carries a Flag, and you need to ma... |
I've enjoyed reading this site; this is my first question. Edits are welcome.
Given positive integers \$n\$ and \$m\$, compute all ordered partitions of \$m\$ into exactly \$n\$ positive integer parts, and print them delimited by commas and newlines. Any order is fine, but each partition must appear exactly once.
For e... |
First question here, don't yell at me if this is a duplicate or a bad challenge.
Introduction
I thought of this challenge myself, and it seems to be a good basic puzzle for beginner code-golfers. It also might help me decide which code-golfing language to learn.
Challenge
Given an array of integers that are less than o... |
Before anyone says anything, similar and similar. But this is not a dupe.
Some positive integers can be written as the sum of at least two consecutive positive integers. For example, 9=2+3+4=4+5. Write a function that takes a positive integer as its input and prints as its output the longest sequence of increasing con... |
Write a function or program that takes as its input a string and prints a truthy value if the string is a pangram (a sequence of letters containing at least one of each letter in the English alphabet) and a falsey value otherwise.
Case of letters should be ignored; If the string is abcdefghijklmnopqrstuvwXYZ, then the ... |
Your task is simple: given two integers \$a\$ and \$b\$, output \$\Pi[a,b]\$; that is, the product of the range between \$a\$ and \$b\$. You may take \$a\$ and \$b\$ in any reasonable format, whether that be arguments to a function, a list input, STDIN, et cetera. You may output in any reasonable format, such as a retu... |
A Quat is a combination of a quine and the popular esolang cat program.
Challenge
The challenge is to write a standard cat program. Whatever the user inputs, the program will echo the input to stdout.
However, when the length of the input is greater than 0 and a multiple of 4, the program should output its own source c... |
I don't like strings with more than three vowels in a row. Can you write a program that removes all the vowels I don't want from words?
You may write a program or function, taking input via STDIN (or closest alternative), command-line argument or function argument and outputting the result via STDOUT (or closest altern... |
Inspired by this question by @CᴏɴᴏʀO'Bʀɪᴇɴ.
Taken from the question:
Your task is simple: given two integers a and b, output ∏[a,b]; that
is, the product of the range between a and b. You may take a and b in
any reasonable format, whether that be arguments to a function, a list
input, STDIN, et cetera. You may ... |
Heavily inspired by Programming a Pristine World. Also closely related to this challenge.
Let's define a pristine prime as a number which is itself prime, but will no longer be prime if you remove any contiguous substring of N base 10 digits, where 0 < N < digits in number.
For example, 409 is a pristine prime because... |
About the Series
First off, you may treat this like any other code golf challenge, and answer it without worrying about the series at all. However, there is a leaderboard across all challenges. You can find the leaderboard along with some more information about the series in the first post.
Although I have a bunch of i... |
Don't you hate it when you want to copy-paste a list of numbers (vector, array ...), from one program to another, but the format you have the numbers on doesn't match the format you need it on?
For instance, in MATLAB you may have a space separated list like this:
[1 2 3 4 5] (you can also have it comma separated, ... |
Background
The convex hull of a finite number of points is the smallest convex polygon that contains all of the points, either as vertices or on the interior. For more information, see this question on PGM which defines it very well.
Input
N+1 2-D coordinates (N >= 3) passed through STDIN (with other usual golf inputs ... |
The task is very simple, when given an input, output one of the following spirals:
Input = 1 gives a spiral with the letter A beginning in the top left corner:
A B C D E F
T U V W X G
S 5 6 7 Y H
R 4 9 8 Z I
Q 3 2 1 0 J
P O N M L K
Input = 2 gives a spiral with the letter A beginning in the top right corner:
P Q R S T... |
Disclaimer: while I have been on this site for entertainment purposes for a little while now, this is my first question, so please forgive any minor errors.
Background
When assigning us homework, my teacher is really annoying and writes out all the problems we have to do individually. As such, it takes me forever to co... |
This is a king of the hill challenge for Dots and Boxes (aka Pen the Pig). The game is simple, on your turn just draw a line on an empty fence. Every time you complete a square you get a point. Also, since we are playing by championship rules, if you complete at least one square on your turn you get an extra turn. This... |
The challenge this time is to find the nth Fibohexaprime. The definition of a Fibohexaprime is as following:
We first observe a list with Fibonacci numbers:
N | Fibonacci number
1 | 1
2 | 1
3 | 2
4 | 3
5 | 5
6 | 8
7 | 13
8 | 21
9 | 34
10 | 55
11 | 89
12 | 144
13 | 233
14 | 377
15 | 610
16 | 987 ... |
Background
Very skilled card handlers are capable of a technique whereby they cut a deck perfectly in half, then perfectly interleave the cards. If they start with a sorted deck and perform this technique flawlessly 52 times in a row, the deck will be restored to sorted order. Your challenge is to take a deck of cards ... |
Rolling the Dice
So, I was rolling dice a while ago and thought of a challenge.
Given the cube with a net taken from input and a list of moves, find the square on the bottom at the end.
I will use this image for the examples here.
Input
You take in a string with a list of moves. The string contains only the capital A... |
Inspiration from Puzzling.SE.
Suppose we have an m × n grid such that each element is a base 10 digit. We can read the numbers from such a grid so that we fix a starting element, go to one of the eight nearest coordinates and maintain that direction for zero to five steps. This allows you to read a one to five digit nu... |
Given a non-negative integer input, write a program that converts the number to hexadecimal and returns a truthy value if the hexadecimal form of the number contains only the characters A through F and a falsey value otherwise.
Test cases
10
==> True (A in hexadecimal)
100
==> False (64 in hexadecimal)
161
==> False... |
Introduction
The task is simple. When given a number, output the most logical rectangle. To explain what a logical rectangle is, I provided some examples:
Input: 24.
All possible rectangles have the form A x B, (A and B are both positive integers). So, all possible rectangles for 24 are:
1 x 24
2 x 12
4 x 6
From this... |
Given a string input, write a program that prints a truthy value to STDOUT or equivalent if the input is a valid UUID, without using regexes.
A valid UUID is
32 hexadecimal digits, displayed in five groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters and four h... |
Inspired by Alex's glorious Learn you an R for great good, we are going to humbly recreate Alex's "one true R program" -- but with a twist.
Alex-style Addition works like this -- it has a 90% chance of simply returning the sum of the two numbers given and a 10% chance of recursively Alex-adding the first number and the... |
Here is a list of some common
ligatures in Unicode (the
ones I could create with my Compose key on Debian):
Orig Ascii Lig
ae [ae] æ
AE [AE] Æ
oe [oe] œ
OE [OE] Œ
ij [ij] ij
IJ [IJ] IJ
ff [ff] ff
fi [fi] fi
fl [fl] fl
ffi [ffi] ffi
ffl [ffl] ffl
You have two options in this ... |
After you wake in a dark room, you see a rectangular grid of lights with corresponding switches. You decide to use a coordinate system with the bottom left light representing (1,1) and the coordinates increasing as you go up (y direction) and to the right (x direction). The grids are identical in that flipping the swi... |
Given a string you must move each letter (starting from the first letter) by its position in the alphabet. If you reach the end of the string you must wrap around. Non-letters don't need to be moved.
Example:
Dog
D is the fourth letter in the alphabet so we move it four spots to the right. After wrapping around, that c... |
Create a program that solves a mathematical expression using the elements from alternating sides of the expression. The way it’s done is, instead of reading from left to right, you read the first character, then the last, then the second, then the second to last etc. This will give you a new expression that you must ev... |
The Background
Folks were talking prime factorization in chat and we found ourselves talking about repunits. Repunits are a subset of the numbers known as repdigits, which are numbers consisting of only repeating digits, like 222 or 4444444444444444, but repunits consist only of 1.
The first couple repunits are therefo... |
Why was 6 afraid of 7? Because 7 8 9!
Given a string apply the following transformations:
If there is a 6 next to a 7 remove the 6 (6 is afraid of 7)
If the sequence "789" appears remove the 8 and the 9 (7 ate 9)
(If I'm not mistaken it doesn't matter what order you do the transformations in)
Keep applying these tran... |
Defenestration is the act of throwing someone or something out of a window.
—Wikipedia
Input
The input will consist of two parts:
A floor plan and a person inside the house/building.
v><^ represents a person, pointing in the direction signified by the arrow. The input will contain exactly one person.
- and | repres... |
Goal
You're playing a computerised chess game. The display is in black and white only and the pixels are chunky. White pixels use a lot power compared to black pixels and you're concerned about your carbon footprint.
Given a square and a piece in chess notation, return the number of white pixels displayed in the squa... |
Your input will be a integer between 1970 and 2090 (inclusive), representing a year. Your program should output the next year on which New Years Day falls on the same day of the week as the input year.
Test Cases:
Below are the sample inputs and outputs
2001 => 2007
2047 => 2058
2014 => 2020
1970 => 1976
1971 => 1982
1... |
Stack Exchange automagically detects serial
voting (when one user either
upvotes or downvotes many of another user's posts) and reverses it. In this
challenge, you will implement a very, very simple "serial vote" detector.
Input
The input is a string representing a list of votes. Every group of two
characters represent... |
Challenge: write a single script file foo.cmd which can be invoked from the vanilla Windows cmd.exe prompt (not PowerShell, not in administrator mode), to execute arbitrary Windows-specific code...
> .\foo.cmd
Hello Windows!
...but also be invoked unaltered from a typical POSIX-compliant (Linux/OSX) shell prompt (ba... |
Input
Two dates, each comprising of a month (Dec or Jan) and a day (01-31). These will be given as 4 integers (12 01 01 01, for example), in any reasonable format you choose (leading zeroes, no leading zeroes, list, individual inputs, list of lists, etc.). The first date is supposed to represent today's date.
Output
I... |
In Dungeons & Dragons, almost everything is decided by rolling a die. Typically, if the roll is greater than or equal to a specified value, your attempt at doing whatever you wanted to do succeeds, and fails otherwise. Most commonly, a 20-sided die (aka d20) is used to roll.
Other times, the skill challenge system is u... |
Introduction
If you're not familiar with Hexagony, it's an esoteric language created by Martin Büttner. The thing is that this language accepts multiple forms for the program. The following programs are all equivalent:
abcdefg
and
a b
c d e
f g
So basically, the code has been rolled up into a regular hexagon. But n... |
Apply an indefinite integral to a given string. The only rules you will be using are defined as such:
∫cx^(n)dx = (c/(n+1))x^(n+1) + C, n ≠ -1
c, C, and n are all constants.
Specifications:
You must be able to integrate polynomials with any of the possible features:
A coefficient, possibly a fraction in the format ... |
Center The Text!
In this challenge you will be centering various lines.
Examples
Foo
barbaz
Foo
barbaz
Hello
World
Hello
World
Programming Puzzles
&
Code Golf
Programming Puzzles
&
Code Golf
Specifications
Each input line will always have at least one non-whitespace character, you may assume the on... |
Let's play Russian Roulette!
Normally, this would be a race to write the shortest MOD 6 program, but that's not very realistic, as the chance of winning decreases with each click. Here are the rules:
Emulate a real six-shooter:
A single bullet is placed into one of the six chambers, and the barrel is spun once, onl... |
The cofactor matrix is the transpose of the Adjugate Matrix. The elements of this matrix are the cofactors of the original matrix.
The cofactor (i.e. the element of the cofactor matrix at row i and column j) is the determinant of the submatrix formed by deleting the ith row and jth column from the original matrix, mul... |
Your task is to program a robot so that it reaches the hole in the ground on each of the maps within reasonable time. If the robot reaches the hole, it falls down into it and thus victory is assured, even if the program never stops running.
Since the robot has to be programmed by manually punching in ones and zeroes, y... |
In this code golf, you will have to determine the direction of the shortest shot that hits exactly n cushions before falling into a pocket.
The billiard table is a 6 pocket pool table with the following characteristics:
Dimensions are variable (a x b)
No friction : the ball will roll forever until it falls into a pock... |
Duolingo, the language learning app, has a lot of things going for it, but there is one major issue that drives me crazy. It tells me how many days in a row I've used the app with a message like You're on a 7 day streak! Setting aside hyphenation and whether the number should be spelled out, this works fine for most nu... |
The nth Motzkin Number is the number of paths from (0, 0) to (n, 0) where each step is of the form (1, -1), (1, 0) or (1, 1), and the path never goes below y = 0.
Here's an illustration of these paths for n = 1, 2, 3, 4, from the above link:
The desired sequence is OEIS A001006. OEIS has some other characterizations o... |
Your task is to output a single number; the number of ISO weeks that a given date range intersects. To quote Wikipedia: An average year is exactly 52.1775 weeks long, but this is not about the average.
Input consists of two space-separated ISO dates:
0047-12-24 2013-06-01
The end date is never before the start date. W... |
Drawing the Sierpinski triangle has been done to death. There's other interesting things we can do with it though. If we squint hard enough at the triangle, we can view upside-down triangles as nodes of a fractal graph. Let's find our way around that graph!
First, let's assign a number to each node. The largest upside-... |
Introduction
In base 10, the Champernowne constant is defined by concatenating representations of successive integers. In base 10: 0.1234567891011121314151617... and so on.
You can see that the first appearence of 15 starts at the 20th decimal:
Position
00000000011111111112222222222333333333344444444445555555555666... |
This is inspired by one of Downgoat's questions in Sandbox, where I suggested that he include April 31 as Pi day for people who use day/month format, only for him to inform me that there is no April 31!
Given a date string in month/day format that might be invalid, output the correct date using rollover. (First rollove... |
In this challenge you will be converting a mixed number to an improper fraction.
Because improper fractions use fewer numbers, your code will need to be as short as possible.
Examples
4 1/2
9/2
12 2/4
50/4
0 0/2
0/2
11 23/44
507/44
Specification
You may assume the denominator of the input will never be 0. The inpu... |
In this challenge posed by xnor, we were asked to implement XOR multiplication. In this challenge the goal is to find the first n XOR primes. XOR primes are very similar to regular primes as you can see by the following definitions:
Definition of Prime Number: A positive number greater than 1 which cannot be formed thr... |
If you like this, consider participating in:
The Official Dyalog APL 2016 Year Game
The monthly Dyalog APL 2017 Code Golf Challenge
Make 12 snippets/expressions, in the same language, that result in the numbers 0 through 10, and 42 respectively, but without writing any literal numeric, string, or character data.
Bui... |
Because there are not enough simple code-golf challenges:
Create an optionally unnamed program or function that, given (by any means) an integer 1 ≤ N ≤ 10000, outputs your language's True value with a pseudo-random probability of 1/N, False otherwise.
Please note that the requirement for naming has been removed. Feel ... |
Let's map some strings to 2d space, fractal style. Your task is to compute a Hilbert curve and lay a string along it.
Task
The task is to take the single-line input string, and lay it out along a Hilbert curve big enough to contain it, but no bigger. Try to make the byte count as low as possible; this is code-golf aft... |
Santa's Decision:
In this challenge, you will help Santa Claus decide whether somebody on their list has been naughty or nice, and subsequently get coal or toys.
But unfortunately, Santa is unorganised, in some of his entries, the naughty, nice and name fields are in the wrong order.
Input
Input will come in the follo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.