instruction stringlengths 34 53.1k |
|---|
Write a program that takes in a string containing only spaces, newlines, and angle brackets: <, > (chevrons). Output a string of spaces, newlines, and slashes: /, \ (soliduses) whose shapes correspond to the input, but rotated a quarter turn clockwise, with a column of spaces inserted between each row of the original i... |
The following challenge is basically a simpler version of the one proposed by Dennis (Lossy ASCII art compression). I found the idea super interesting but a bit too convulted, and seeing as it didn't seem to be getting much attention I decided to modify it a little bit.
You'll be downloading 5 ASCII art text files, eac... |
What is the shortest C# statement that will convert a string representation of a number to an int[] that contains each digit?
string number = "1234";
number.Array.ConvertAll(line.ToCharArray(), c => Int32.Parse(c.ToString()));
number.ToCharArray().Select(i => Convert.ToInt32(i.ToString())).ToArray();
number.Select(i =>... |
Intro:
I remember, when I was a kid, I would get a calculator and keep on pressing the + button, and see how high I could count. Now, I like to program, and I'm developing for iOS.
Counting is a fundamental skill for both humans and computers alike to do. Without it, the rest of math can't be done. It's done simply by ... |
Summary
Inspired by the recent popularity of ASCII art challenges, this challenge's purpose is to draw an ASCII checkerboard, like one on which Chess can be played.
Write a program that takes a positive integer n as an argument, in stdin, or as user input, and output an checkerboard with nxn squares, along with a borde... |
Pronouncing Hex
For those of you uninitiated with the show Silicon Valley, this challenge is inspired by an exchange that goes like this (YouTube):
Kid -
Here it is: Bit… soup. It’s like alphabet soup, BUT… it’s ones and zeros
instead of letters.
Erlich Bachman -
{silence}
Kid -
‘Cause it’s binary? You know, b... |
A maze on an N by N grid of square cells is defined by specifying whether each edge is a wall or not a wall. All outer edges are walls. One cell is defined as the start, and one cell is defined as the exit, and the exit is reachable from the start. The start and exit are never the same cell.
Note that neither the start... |
Your task is to solve the Longest Common Subsequence problem for n strings of length 1000.
A valid solution to the LCS problem for two or more strings S1, … Sn is any string T of maximal length such that the characters of T appear in all Si, in the same order as in T.
Note that T does not have to be a substring of Si.
... |
For your hard thing to do, you must make a thing for a computer to do that finds out if some words are explained in a simple way. Something is explained in a simple way if it only uses the ten hundred most used words. If not, it is explained in a hard way. This can be a full computer thing or part of a computer thing. ... |
You should write a program or function which receives an integers as input and outputs or returns two integers whose sum is the first one.
There is one further requirement: no number can be part of the output for two different inputs.
Details
You should be able to handle inputs for at least the range -32768 .. 32767 (... |
In addition to contributing to Stack Overflow and other SE sites, I like to ride public transit during my free time. I'd be spending a fortune on cash fare and/or bus tickets every month if I didn't have a bus pass. But for the average passenger, how much would you need to ride to make it worthwhile to buy a pass?
Inpu... |
The Fibonacci sequence is a well known and famous sequence, where each successive element is the sum of the previous two. A modular Fibonacci sequence is the same, except that the addition is performed over a finite field, or to put it another way, a modulo operation is performed after each addition.
For instance, the ... |
This is a mini golf hole:
The outer boundary is a circle with radius 10 and center (0,0). The inner boundary is a circle with radius 3 and center (0,5). The tee is at (0,-8). Assume the ball is just a point with radius 0.
The dynamics of the ball are governed by the following rules:
The ball is initially hit with ene... |
Knockout is a basketball game where players take turns shooting. It is played as a sequence of two-player contests, each of which has the possibility of "knocking out" one of those players.
Suppose the players are A B C D and their chances of shooting and making a basket are 0.1 0.2 0.3 0.4 respectively, independently ... |
Inspired by this question earlier today, I'd like to see interesting ways various programming languages can turn a numpad into probabilities. Commonly, tile-based games will allow you to use a numpad to move in any direction based on where your character currently is. When making an AI for these games, Math.random() * ... |
Your goal is to generate a Fibonacci spiral with numbers.
Example Input / Output
1 -> 1
2 -> 1 1
3 -> 1 1
2 2
2 2
6 -> 8 8 8 8 8 8 8 8 5 5 5 5 5
8 8 8 8 8 8 8 8 5 5 5 5 5
8 8 8 8 8 8 8 8 5 5 5 5 5
8 8 8 8 8 8 8 8 5 5 5 5 5
8 8 8 8 8 8 8 8 5 5 5 5 5
8 8 8 8 8 8 8 8 1 1 3 3 3
8... |
Instead of normal binary, you must count from 1 to an input in negabinary concatenated to negaquaternary.
Here's an example, put in the form of an array:
[11, 1102, 1113, 100130, 101131, 11010132, 11011133, 11000120, 11001121, 11110122, 11111123, 11100110, 11101111, 10010112, 10011113, 10000100, 10001101, 10110102, 101... |
The Borromean rings are a curious set of three circles, linked such that the removal of any one of them will unlink the other two:
You can make a set for yourself with a couple rubber bands and a binder ring. With more rubber bands, it's easy to make any Brunnian link.
Write a program or function that outputs (prints ... |
Recently there was a question on Stack Overflow where the OP was trying to write a function to find the word in a string that has the most repeated letters. It is of course not hard to write one up in seconds, and I wrote one in Javascript as short as I can for fun. But I'm not an expert in code golfing, so I wonder ho... |
(Note: I know that the VSEPR method fails sometimes, and that there are exceptional molecules. The challenge is about the molecules which conform.)
Most people who have taken an introductory chemistry course know about molecules, and (probably) the VSEPR theory of chemical bonding. Basically, the theory predicts the ... |
A friend of mine got this question during an interview.
The interview ended with no luck for him, but still, we're very curious to hear the solution. The question is as follows:
Modify the code below (change 3 lines maximum) so the function will return the length of the longest sequence of the same bit, if you would fl... |
You have a box with a single digit number in each corner:
1|2
---
3|4
If we concatenate the digits along rows left to right, we get 12 and 34. If we concatenate the digits along columns top to bottom, we get 13 and 24. If we add all of these numbers, we get 12+34+13+24 = 83.
Challenge
Write a program to print all such... |
Revised formatting and instructions
Given a list of moves for a Cracker Barrel peg board game, or as @Steveverrill stated, Peg Triangle Solitaire:
Game 1 Game 2 Game 3
1: 0 ,-1, -1 C, -1, -1 4, -1, -1 #starting point
2: 3, 1, 0 3, 7, C B, 7, 4 #jump_from, jump_over, jump_to
3: A, 6... |
C++ implements a Turing-complete functional programming language which is evaluated at compile time.
Hence, we can use a C++ compiler as an interpreter to run our metaprogram without ever generating code. Unfortunately, static_assert won't allow us to emit our result at compile-time, so we do need* to generate an exec... |
The Simpson index is a measure of diversity of a collection of items with duplicates. It is simply the probability of drawing two different items when picking without replacement uniformly at random.
With n items in groups of n_1, ..., n_k identical items, the probability of two different items is
For example, if you ... |
You should write a program or function which receives a list of digits as input and outputs or returns the largest sum achievable by putting these digits in a square.
Input will always contain a square number of digits. An example square arrangement for the input 9 1 2 3 4 5 6 7 7 could be
677
943
125
The sum is calcu... |
This is the first problem I've posted here; please post criticisms in comments.
Summary
A game board consists of a starting space, an ending space, and between them are N spaces, each with an instruction. You begin on the starting space with 0 points to your credit. Flip a coin or roll a die to choose the number 1 or 2... |
While moving, I broke my lamp. Now, I need a new one. It's your job to make me a lamp! I'm not sure what size I want, though I know I want a squiggly one.
Your program/function must take in a number input, and print out a lamp with that many squiggles/bumps.
Examples:
Input:2
Output:
/--\
()
()
/__\
Input:3
Output:... |
We live in a wonderful age of technology where we can have beautifully detailed 8K screens on our TVs, and even 2K displays on our phones for our mobile browsing pleasure. We've come a long way in recent years in terms of screen technology.
One of the products of this is a term that was made popular by Apple, Retina. ... |
Write a program that takes in a string where every line consists of the character 0 indented by some number of spaces. The top line is not indented and every other line will be indented by at most one more space than the line just before it.
No lines will have trailing spaces but you may optionally assume there is a si... |
You must write a program that encrypts an input into a string of characters.
For every character i in the input up to the second to last character, take the i and i+1 characters and encode them by writing the letters of the alphabet, in order, that range in the same direction between those chosen characters.
For examp... |
Average color of an image
Scientists have been able to determine the average color of the universe but in how many bytes can we find the average color on an image?
Your task
Your input will be a single image which you will need to find the average of the colors in the image and output a hex color-string (#??????). The ... |
Your Goal: Estimate pi to at least 10 decimal places. The format is your choice - it can output as a number, as a string, as an output to STDOUT, etc.
Seems easy, right? But wait, it's not as simple as it seems...
The Rules: You get exactly 10 function calls (this includes operators). These functions cannot be ones tha... |
Some characters are more holy than others. Using as few unholy letters as possible, display the statement above.
Challenge
Write a full program to print Holy Hole In A Donut, Batman! to STDOUT or closest alternative. If you can compress the input to reduce your score, go wild :)
Input
None
Output
Holy Hole In A Donut, ... |
The task is to compute the divisor sum of a number given its prime factorisation.
Input
Two arrays (or something equivalent) of length n, one containing the prime factor and the other containing the corresponding exponent.
Output
The sum of all divisors (including the number itself).
Example
The number 240 has 2, 3, an... |
Your Task
Given a list of words, check if they form a valid word grid. They form a valid grid if there are N words with N letters and they spell the same words vertically as they do horizontally. The words can be given in any order. [FILE, ICED, LEAD, EDDY] = True and [FILE, LEAD, EDDY, ICED] = True. Print True if it i... |
This is a simple challenge:
Given a sequence of integers, find the sum of all integers in it.
But with a twist.
Your score is the Levenshtein distance between your code and the following phrase (The challenge):
Given a set of integers, find the sum of all integers in it.
You may assume there are no newlines or traili... |
Write a program that takes in a standard truecolor image and a single 24-bit RGB color (three numbers from 0 to 255). Modify the input image (or output a new image with the same dimensions) such that its average color is exactly the single color that was input. You may modify the pixels in the input image in any way yo... |
A function (or program) which takes inputs and provides outputs can be said to have a cycle if calling the function on its own output repeatedly eventually reaches the original number. For instance, take the following function:
Input: n 1 2 3 4 5 6
Output: f(n) 5 7 1 3 4 9
If we start with n=1, f(n)=5, f(f(n))=f(5... |
This is a sequel to this challenge: Code close to the challenge: Sum of integers
The challenge in this one is a bit harder, and also makes for a cool title (Which is why I picked it):
Calculate the Levenshtein distance between two strings
Just like last challenge, your score in this challenge is the Levenshtein dista... |
This is the followup question to this previous CodeGolf question about Covering Arrays (the details of what Covering Arrays are and how they are formatted at the NIST website are there).
In this challenge, we won't just be validating covering arrays - we will try to minimize them. Finding minimal Covering Arrays, in ge... |
Background
A question wanted to solve a problem in a way that made it unreasonably complex: https://stackoverflow.com/a/31551257/29347
The problem in the original question is:
Take a list of (key, value) and produce a dict such that {key: sum(value)}
My Problem
I want to use dict compression with list.count or str.c... |
Task
Your task is to produce string that contains average characters of string.
First character of result would be average character of first character (which is first character) and second character average of two first characters and so on.
What is average character?
Strings are arrays of bytes. Average character of ... |
I'm a huge video game music fan. One of my favorite OSTs is that from Kingdom Hearts, by Yoko Shimomura.
The challenge
Create a program or function that takes two arguments in any format: an abbreviated Kingdom Hearts game and a boss in that game. It must return the name of the song that plays for that boss. The progra... |
Through the bases
In this challenge, you will be taking a number through all the bases of the rainbow
Given an input, n, you will output n in every base from 9 to 2, and back up to 9. That's 9 8 7 6 5 4 3 2 3 4 5 6 7 8 9.
Example:
>>> 16
17
20
22
24
31
100
121
10000
121
100
31
24
22
20
17
Rules:
You input can be a s... |
In the game Hearthstone there is a playing board containing friendly and enemy minions, and two heroes - yours and the enemy's.
To generalize and simplify, we will assume it's your turn, the opponent has 0-7 minions with given health values on the board, and is at H life points. We will ignore our side of the board ent... |
So, blatantly plagiarizing from inspired by this challenge and its sequel, I thought I'd add another.
The text to match:
What do you get when you multiply six by nine
The result your function/program/etc. should print or return:
42
An online calculator for Levenshtein distance can be found here: http://planetcalc.... |
A stretchy snake looks something like this:
<||=|||:)~
Each separate sequence of vertical bars (|) in a stretchy snake, known as a stretchy portion, is individually extendable to twice its width, and is drawn with alternating slashes (/,\) once extended.
The particular snake above has two such stretchy portions, givin... |
You are a space tourist on your way to planet Flooptonia! The flight is going to take another 47,315 years, so to pass the time before you're cryogenically frozen you decide to write a program to help you understand the Flooptonian calendar.
Here is the 208-day long Flooptonian calendar:
Month Days Input Range... |
Digging around in the depths of your temp folder, you find some compositions for the piano. Unfortunately, these compositions were written with note names and durations only, and you only have access to a text terminal. Therefore, your task is to write a program to display the compositions as ASCII art.
Input
Your prog... |
Synopsis: Given the output of a generalised FizzBuzz program, return the list of factors and words used for the program.
Challenge Description
Imagine a generalised FizzBuzz program that takes in as input a list of factors and words to use and the number to start from. For instance, if the input of this program was
3... |
This is a fairly simple question. According to this random website I found — Web Archive, a reference angle is the acute angle formed by the terminal side of the given angle and the x-axis. You have to write a program to find these.
I don't remember anything from algebra 2, what does this mean?
Angles are usually given... |
I've been scrolling around this site for a while, but just recently got really interested in actually trying out some of the challenges. I was intending to try my hand at some of the existing code-golf topics, but I didn't have Internet access for a while yesterday, and in the meantime, I thought up my own challenge.
Y... |
The puzzle:
Consider a console/hand-held game with a d-pad where you are required to enter a name of sorts. This appeared in many older games before the use of QWERTY was popularised in consoles (e.g. I believe the Wii uses a QWERTY keyboard layout for input). Typically, the on-screen keyboard looks to the effect of*:
... |
Implement a CipherSaber encryption program, as described below. Guidelines:
The smallest entry, in bytes, wins.
However, in a departure from code-golf norms, you are welcome to post interesting entries, even if they aren't serious golf entries.
An entry would typically be a program that takes the plaintext from sta... |
In as few bytes as possible, write a program or function that outputs the following:
Abcdefghijklmnopqrstuvwxyz
aBcdefghijklmnopqrstuvwxyz
abCdefghijklmnopqrstuvwxyz
abcDefghijklmnopqrstuvwxyz
abcdEfghijklmnopqrstuvwxyz
abcdeFghijklmnopqrstuvwxyz
abcdefGhijklmnopqrstuvwxyz
abcdefgHijklmnopqrstuvwxyz
abcdefghIjklmnopqrs... |
The lost pawn problem
After the chess game ended, a surviving pawn was left behind enemy lines. let's help him find the shortest way back home.
The original problem describes a nXn "chess" board, and a function f: {1,..,n-1}X{1,..,n}X{-1,0,1} => R+ of weights. the goal is to find the best path from some square in the b... |
Goal: Write a program or function which prints an input string in a sinusoidal shape.
The ASCII sinusoid
Here is one period of the sinusoid:
.......
... ...
.. ..
. . ... |
It's very easy:
Create a program without writing a single line of code. The code may only consist of existing Stack Overflow questions and answers.
The program should create two random numbers and output the numbers
added to,
subtracted from,
multiplied with and
divided by
each other.
Rules
You must include lin... |
Fannkuch is a classic benchmark program. The name comes from the German "Pfannkuchen"- pancakes- for the algorithm's resemblance to flipping stacks of pancakes. A Fannkuch sequence of numbers is formed as follows:
Take a permutation of {1.....n}, for example: {4,2,1,5,3}. Take the
first element, here 4, and reverse ... |
Introduction
After a long battle, you have managed to defeat a Sphinx in a contest of riddles. The Sphinx, impressed with your skill, wishes to give you a reward commensurate with your cleverness, and conjures into existence a strip of magical parchment divided into eight boxes, each containing a numeral.
"Crease the ... |
your shift key is broken. wheNever you type two lines, the cApitaL
LetteRs in them get swappeD. you must write a program to fiX THIS!
Description
The input is two strings, s1 and s2, equal in length. They will each contain only printable ASCII and be at least one character in length. You may input these as two strings,... |
The Knödel numbers are a set of sequences. Specifically, the Knödel numbers for a positive integer \$n\$ are the set of composite numbers \$m\$, such that all \$i < m\$, coprime to \$m\$, satisfy \$i^{(m-n)} \equiv 1 \mod m\$. The set of Knödel numbers for a specific \$n\$ is denoted \$K_n\$. (Wikipedia).
For example, ... |
The so-called Will Rogers phenomenon describes a way to tweak statistics by raising the average in two (multi)sets when one element is moved between the two sets. As a simple example, consider the two sets
A = {1, 2, 3}
B = {4, 5, 6}
Their arithmetic means are 2 and 5, respectively. If we move the 4 to A:
A = {1, 2, ... |
This is Calvin. Just trying to get 20 rep so this user can chat in the PPCG Minecraft Server chatroom.
Write a program or function that takes in a positive integer.
If the integer is even (2, 4, 6, ...), print or return this exact ASCII art string:
__ __ __ __ ___
/\ /\ | ... |
Mr. Mackey is a South Park character well-known for adding "m'kay" in everything he says.
Write a program or function that transforms a string of text into something Mr. Mackey would say.
M'kay placement
m'kay has a random 50% chance of being added after the punctuations ,, ., ? and !. If that is the case, it will be... |
Your mission, if you choose to accept it, is to create a stack that can do basic math operations.
Explanation:
Your stack must be able to do basic arithmetic (+-*/) and must support normal base 10 numbers (0123456879); numbers will only be one character long.
Programming:
Input from stdin will be loaded as a program. ... |
Censors are a common tool used on the interwebs. But they often censor too much of the word, and thus make the cursing ambiguous to the reader. And sometimes they don't censor enough, so the words still remain offending. Your task is to fix that.
Your task
Write a program/function/whatever that takes two lists and a st... |
My first ever Programming Puzzles & Code Golf is the Seven-Slash Display. Here is my first Challenge, also based on 7-segment display.
I often think about, besides numbers, what kind of letters I can display using a simple 7 segment display. Turns out a lot of letters can be displayed. In fact, all but the letters K, M... |
Marching Squares is an algorithm from computer graphics, which is used to recover 2D isocontours from a grid of samples (see also, its big brother Marching Cubes for 3D settings). The idea is to process each cell of the grid independently, and determine the contours passing through that cell based on the values at its ... |
Challenge
Given a number of seconds past midnight, output the smallest angle between any two hands on a clock face, using as few bytes as possible.
You may assume that the number of seconds is always less than 86400.
Angles may be represented in degrees or radians.
A reference solution is at: http://ideone.com/eVdgC0
T... |
Write a program that will produce differing behaviors on as many different platforms as you can. Each differing platform awards one point (including an initial platform, meaning you can't score less than 1*). Mechanisms intended for determining the target/executing platform (e.g. through platform compilation statements... |
Average out two lists
Challenge
Given two lists of positive integers, determine whether it is possible to rearrange the elements into two new lists such that the new lists have the same arithmetic mean (average).
Input
The input can be taken through STDIN or as function arguments. Input can be taken as a list, or if yo... |
Goal:
Write a function or program that, given an integer n, will output a program in the same language that is a quine with a period of n.
Description of Output Program:
The output program needs to be a program that, when run, ... will output a program... that will output a program... etc, until the nth program is the ... |
figlet is utility that converts plain text to an ascii-art representation for use in banners and the like. For example:
$ figlet "CODE GOLF"
____ ___ ____ _____ ____ ___ _ _____
/ ___/ _ \| _ \| ____| / ___|/ _ \| | | ___|
| | | | | | | | | _| | | _| | | | | | |_
| |__| |_| | |_| | |___ ... |
Capacitors are notorious for being manufactured with high tolerances. This is acceptable in many cases, but some times a capacity with tight tolerances is required. A common strategy to get a capacity with the exact value you need is to use two carefully measured capacitors in parallel such that their capacities add up... |
You should write a program or function which receives the volume of a bowl and the volume of the water in it as input and outputs or returns an ASCII representation of a bowl with water in it with the desired volumes.
A bowl has the following structure:
\ /
\___/
The bowl has at least one _ character. The count... |
This is a fairly simple code golf challenge. Your program, given an ASCII string, is to parse that string into two strings, which it will evaluate. If the second string is "later" than the first one, it will return a 1, if it is "earlier" than the first one, it will return a -1, and if they are the same, it will return... |
Write a few lines of Python code, X, that does not reference any global variables, such that
def method():
X
print(a)
method()
prints 1 but
def method():
X
X
print(a)
method()
prints 2.
So, I hate to be a stickler, but it seems like vars and locals are actually global variables in Python:
def t... |
I found an old post on Jon Skeet's blog that pointed out a puzzle from a tweet by Vladimir Reshetnikov:
C# quiz: write a valid C# program containing a sequence of three tokens ? null : that remains valid after we remove the null.
Note that the wording "three tokens" is important: "? null :" is a single string literal... |
Challenge
Given the equation of a line and the coordinates of the vertices of a shape, output the coordinates of the shape when reflected across the given line.
Further Information
The line's equation will be given with a y and an x separated by an equals sign (there may not always be a y and an x). Some examples:
y=x
... |
Background
A bijective base b numeration, where b is a positive integer, is a bijective positional notation that makes use of b symbols with associated values of 1 to b.
Unlike its non-bijective counterpart, no symbol has a value of 0. This way, each non-negative integer n has a unique representation in bijective base ... |
When you search something on google, within the results page, the user can see green links, for the first page of results.
In the shortest form possible, in bytes, using any language, display those links to stdout in the form of a list. Here is an example, for the first results of the stack exchange query :
Input :
yo... |
Input
Two integers:
A non-negative integer W in the range 0 to 2^64-1, specifying the weave.
A positive integer S in the range 1 to 255, specifying the side length.
These can be taken in whichever order suits you.
Output
An S by S ASCII representation of the requested weave (S newline separated strings of S character... |
In 2D Mario, Bullet Bill cannons are two units tall. The Bullet Bill is fired out of the upper unit and travels in a straight line (parallel to the x axis).
Mario is two units tall when standing up and one unit tall when ducking. His jump height is three units. It takes him 0.5 seconds to reach the full height and 0.5 ... |
Background
One-hundred and thirteen years ago, amateur cryptographer Félix Delastelle published his work on the four-square cipher, a digraphic substitution cipher that accepts two permutations of a 25-letter alphabet as keys and encodes messages consisting of those letters.
Like most pen-and-paper ciphers, the four-sq... |
Context:
A reclusive billionaire has created a game show to attract the world's best and brightest programmers. On Mondays at the stroke of midnight, he chooses one person from a pool of applicants to be the contestant of the week, and provides them with a game. You are this week's lucky contestant!
This week's game:... |
A subsequence is a sequence that can be derived from another sequence by deleting some elements without changing the order of the remaining elements. A strictly increasing subsequence is a subsequence in which every element is bigger than the preceding one.
The heaviest increasing subsequence of a sequence is the stric... |
Symbolic Differentiation 1: Gone Coefishin'
Task
Write a program that takes in a polynomial in x from stdin (1 < deg(p) < 128) and differentiates it. The input polynomial will be a string of the following form:
"a + bx + cx^2 + dx^3 +" ...
where the coefficient of each term is an integer (-128 < a < 128). Each term is... |
When is it beneficial to use inline, single use importing in Python?
For example:
__import__("x").doSomething()
Is the above ever shorter than the below?
import x
x.doSomething()
Or
from x import*
doSomething()
|
This is the second in a series of puzzles that I will be posting every Monday at Midnight PST. The first puzzle is located Here.
Context:
A reclusive billionaire has created a game show to attract the world's best and brightest programmers. On Mondays at the stroke of midnight, he chooses one person from a pool of app... |
Given an input, calculate the correct suffix and output the number in a readable format in short scale (where 1 billion is 10^9). The suffixes must go to at least 10^3000, in which the rules for calculating them can be found here, or a list can be found here.
There is no need to output the exact numbers, this is focuse... |
The Myriad System is an alternative system for naming large numbers proposed by Donald Knuth in 1981.
In this system, numbers up to 999 are named as they are normally, but 1000 is not given a special name and is instead named as "ten hundred"; the next benchmark number being 10000, or "one myriad" (which, of course, co... |
You are a talented young chef who has just been offered the position of sous chef at the world's most prestigious Indian restaurant. You have little experience with preparing Indian cuisine, but you're determined, so you set out to prove yourself. You decide to become the leading dosa expert. To do this, you must not o... |
Challenge
Code an ASCII cookie of a kind according to the input.
Input
The cookie kind. This is one of the three strings: "Plain", "Chocolate", or "Nuts". May be function arguments, stdin (or closest equivalent), or file arguments.
Output
An ASCII cookie. See below.
Must be
___
/ \
| |
\___/
f... |
Enabling delayed expansion variables in Batch chews up a lot of bytes. The shortest I have managed to make it is:
@!! 2>nul||cmd/q/v/c%0&&exit/b
Saving 11 bytes over @echo off&setLocal enableDelayedExpansion. The method is explained here - Tips for Golfing in Batch. Basically, it runs a command (!!) which fails initia... |
X Marks the spot
Your goal is to add a cross-hair around the capital X:
Example Input / Output
Input:
mdhyyyyyyyhhhddmmm
mdyyssoo oooosyyyhhhdmm
hsso oossoooooyyhhdhhdmmm
yoooooo oo ssysssyhhdyyyhmmmm
myso oso... |
Untouchable Numbersα
An untouchable number is a positive integer that cannot be expressed as the sum of all the proper divisors of any positive integer (including the untouchable number itself).
For example, the number 4 is not untouchable as it is equal to the sum of the proper divisors of 9: 1 + 3 = 4. The number 5 ... |
Write a program or function which, given a positive integer as input, outputs the representation of that integer in Maya numerals.
Maya numerals
Maya numerals is a vigesimal system (base 20) using only 3 symbols :
< > for Zero (The correct symbol is some sort of shell that can't easily be represented using ASCII).
. ... |
In a few British newspapers there is a game known as Hidato. It is somewhat similar to Sudoku, albeit instead of having 1-9 in a line and block, it's about placing numbers such that they connect in order from 01 all the way up to the highest one, so they are all touching horizontally, diagonally or vertically.
Inputs w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.