instruction stringlengths 34 53.1k |
|---|
Challenge
Given two inputs, a positive ion and a negative ion, you must output the formula for the ionic compound which would be made from the two ions. This basically means balancing out the charges so they equal zero.
Do not bother with formatting the formula with subscript numbers, but you must have brackets for the... |
Given an integer 2n, find the number of possible ways in which 2n^2 black pawns and 2n^2 white pawns can be arranged on a 2n by 2n chess board such that no pawn attack another.
A black pawn can attack only a white pawn, and vice versa.
The usual chess rules of attacking follow, i.e, white pawns attack squares immediat... |
In this challenge, you must display ASCII art of a water balloon given the
amount of water that the balloon is filled with:
| __||__ |
| / # #\ |
| |######| |
| |######| |
| |######| |
| |######| |
| |######| |
| \######/ |
| |
| |
+----------+
How to draw the balloon
To display a balloon of size... |
I work from Monday to Friday. I start my day at 8:12 and have lunch from 12:00 to 12:42. My workday ends at 16:30.
If you are wondering why 8:12 and 12:42:
8:00 is the goal, but I never actually make it
12:42 because I take 45 minute breaks, but this works better for the challenge spec
Challenge
Write a function o... |
Background
Hex is a two-player abstract strategy game played on a K×K rhombus of hexagonal tiles.
Two opposite sides of the rhombus are colored white, and the other two black, and the two players, black and white, take turns in placing a token of their color on an unoccupied tile.
The player who first manages to constr... |
Any regular hexagon can be tiled with diamonds, for instance like so (stolen from this question):
______
/_/_/\_\
/_/\_\/\_\
/\_\/_/\/_/\
\/_/\_\/_/\/
\_\/_/\_\/
\_\_\/_/
We'll consider the above a tiling of size 1 (since the diamonds' sides are made of one / or \ each). The same tiling of size 2 would look l... |
This is code golf. The winner is the valid code with the smallest number of bytes.
Challenge
Given inputs M and N, the width and height of a rectangular grid of squares, output a polygon that satisfies the following:
The polygon edges are made up only of square edges: there are no diagonal edges - all are vertical or... |
Nuggets of Code
It's a hypothetical situation where it is Friday evening, and you've invited over the usual golfing buddies to participate in your favourite hobby: code golfing. However, as this is such a brain-draining task, you need to pick up some brain food for the group so you can golf as much as possible off your... |
Goal
Your goal is to write "Code Golf" without using any letters [A-Z, a-z], even in your source code. It can't use of the following special characters either (!, _, <, (, ), ., {, }, ', and >).
Bonus / Scoring
If the code backwards also writes "Code Golf", you get -10.
Good luck!
Standard loopholes disallowed.
Min... |
Background
MIDI files are quite different from WAV or MP3 audio files. MP3 and WAV files contain bytes representing a "recording" of the audio, while MIDI files have a series of MIDI messages stored in MIDI events informing a MIDI synthesizer which virtual instrument to play or a MIDI sequencer the playback tempo that ... |
Notice: This king-of-the-hill challenge has completed. This means that the green checkmark, which has been awarded to C5H8NNaO4 for their entry The Observer will not be moved to any new answer.
You may still submit new entries, but there may be delays in new tournaments running as I am not actively checking for new en... |
There are more than 100 elements in the modern periodic table. You challenge is to output the rounded mass of an element with respect to the input given.
Input
Input will contain an abbreviation of an element.
Input can be taken from any one of the following:
stdin
command-line arguments
function arguments
Input wil... |
I designed a language in which pointer arithmetic is the main tool of programming.
Here are some examples.
(print 0 to 8)
=9[>1=9-*-1.>-1-1]
(print 1 to 10 with spaces in between, character literal extension used)
=1[.>1=10-*-1[>1=' '!>-2+1;-2];1]='\n'!
(compute the factorial of 10)
=10>1=*-1-1[>-1**1>1-1]>-1.
(prin... |
The goal of this challenge is to show how many characters are in the name of a given integer. This is code golf, so the smallest code wins.
RULES
The input will be between 0 and 100 (inclusive). If it is not the program won't return anything.
The result has to be printed as input : answer
Result for 100 is hundred
Fo... |
Given a natural number c as input, our task is finding the fastest way to calculate one -atleast- availabe integer solution (a,b) of pell equation c=a²-b².
Rules
Built-in functions and loopholes arent given any interest.
The program deals with integers (signed), the input is not supposed to abuse this range.
Output can... |
You are transported in a parallel universe where people write mathematical equations on computers as ASCII art by hand. As a LaTeX addict, this is totally unacceptable, and you ought to automate this process somewhat.
Your goal is to write a program that outputs an ASCII version of an equation inputed as a LaTeX math ... |
Given an unsorted list of unique, positive integers, output the shortest list of the longest possible ranges of sequential integers.
INPUT
An unsorted list of unique, positive integers
e.g. 9 13 3 11 8 4 10 15
Input can be taken from any one of the following:
stdin
command-line arguments
function arguments
OUTP... |
Try to write the shortest program or function you can that prints or returns the calculated orthocenter of a triangle.
The orthocenter of a triangle is the intersection point of the three altitudes of a triangle. The altitude of a triangle is a perpendicular segment from the vertex of the triangle to the opposite side... |
(I meant to post this while 1542: Scheduling Conflict
was still the current xkcd, but I had a scheduling conflict.)
Input
The input will be a list of 3n elements, which represent n events. The
first element in each group of 3 will be the name of an event; the second and
third, the start and end time respectively. For ... |
(This is my first Q here, and I don't know much about code golfing.)
Your aim is to predict the winner of an ongoing Snakes and Ladders game.
INPUT
A single number (2-1000) indicating the number of spaces on the board, say x.
Another number (2-4) indicating number of players, say n.
n numbers, each giving the position... |
The game
Nim is a mathematical strategy game, where 2 players take turns taking items from distinct heaps. On your turn, you must take at least one item, and you may take as many as you want, provided that you only take from one heap. The player that takes the last item wins! This is a solved game. Before I go into the... |
This is a simple one: print an ASCII Gantt chart.
Given tasks' ranges (start-time - end-time Tuples), print a Gantt timeline in the form of - characters for each task duration - each task in a new line.
Example
Say my tasks ranges are 28->35, 34->40, 39->44, the Gantt will look like this:
--... |
Challenge
Given guitar tablature you must output the song represented by the tab. This may be to the speakers of your computer or to an audio file (.wav, .mp3, .midi, .aiff, etc.). There will also be a second input for timing.
The tabs may be input via a file or straight to STDIN. The tab will be in ASCII form.
Spec
Al... |
The challenge is to write a program which outputs all characters of the Unicode table from n to z range.
For code "0000" is the first in order and you must skip all blank Unicode combinations.
For example, let n = 134 and z = 300, you must save or print all unicode characters between 0134 and 0300.
The output of the pr... |
INPUT: Any string consisting exclusively of lowercase letters via function argument, command line argument, STDIN, or similar.
OUTPUT: Print or return a number that will represent the sum of the distances of the letters according to the following metric:
You take the first and second letter and count the distance betwe... |
Since today marks the occasion of the 26th leap second ever to occur, your challenge will be to output the date and time of every leap second in GMT or UTC that has occurred so far, as well as the one to occur today.
Input
There is no input.
Output
1972-06-30 23:59:60
1972-12-31 23:59:60
1973-12-31 23:59:60
1974-12-31 ... |
Write a program or function that takes in a string through STDIN or function parameters, tokenizes it by parenthesis, and outputs the tokens on different lines. If the string contains a parentheses error, the program/function must output a falsey value or error message.
Examples:
Input: abc(def)ghi
Output:
abc ghi
... |
Write a program or a function that will output a given string in a staircase fashion, writing each part of a word that starts with a vowel one line below the previous part.
For example:
Input: Programming Puzzles and Code Golf
Output: Pr P C G
ogr uzzl and od olf
... |
This challenge is the first of a series of fewest-operations problems that should be written in the GOLF CPU. You can find the next one here
A partition of a number, N, is a list of numbers that add up to N. A prime partition is a list of prime numbers that add up to N.
For this challenge, you are given a single inte... |
Background
The metallic means, starting with the famous golden mean, are defined for every natural number (positive integer), and each one is an irrational constant (it has an infinite non-recurring decimal expansion).
For a natural number , the metallic mean is the root of a quadratic equation
The roots are always
... |
You may write a program or function that receives an odd, positive integer n, where n >= 3, as either a function argument, command line arguments, or on STDIN (or equivalent for your system), and prints to STDOUT (or system equivalent) an ASCII spiral that spins inward clockwise where the top edge is exactly n characte... |
For an N by N image, find a set of pixels such that no separation distance is present more than once. That is, if two pixels are separated by a distance d, then they are the only two pixels that are separated by exactly d (using Euclidean distance). Note that d need not be integer.
The challenge is to find a larger suc... |
The program must output the letter that is paired the most. For example, if your program was given the following string:
"Sally's friend Bobby searched for seashells."
it must output L because "ll" occurs twice, which is more frequent than the other pair "bb".
Rules:
If more than one letter has 1st place for occurre... |
NetHack is a roguelike game where a player must retrieve the Amulet of Yendor from the lowest level of the dungeon. Commonly played via telnet, the entire game is represented with ASCII graphics. The game is extremely challenging and requires knowledge of many game mechanics in order to succeed.
For the purposes of thi... |
Wireworld is fun for the whole family! Your goal is to create a Wireworld implementation in the shortest amount of code possible.
A Wireworld cell can be in one of four different states, usually numbered 0–3 in software, modeled by colors in the examples here:
Empty (Black)
Electron head (Blue)
Electron tail (Red)
Co... |
Recursive Binary Description
Recently, I made my very first contribution to OEIS by extending and adding a b-file to sequence A049064. The sequence starts with 0, and then the next values are derived from giving a "binary description" of the last item.
For example, the second term would be 10, because there was one 0 ... |
Background
The move-to-front transform (MTF) is a data encoding algorithm designed to improve the performance of entropy encoding techniques.
In the bzip2 compression algorithm, it is applied after the Burrows–Wheeler transform (as seen in Burrows, Wheeler and Back), with the objective of turning groups of repeated cha... |
Write a program or function which, when run, outputs another program or function which is valid in the same language as the original program, and which itself will output another program or function that has the same properties. You must at one point end up back to your initial program or function.
Example
Suppose you ... |
You're sitting in the school cafeteria, microwaving your food like you always do around lunch. Suddenly the programming devil rises from the ashes of your burnt food and proposes a challenge:
Sup guys, I have a challenge.
How did this happen? What did you ever do wrong? Was it that one bad macro in C?
The programming... |
OH GODS NO!! You can't leave us here with Doorknob! It'll be nethack everywhere! - 1d ago by Geobits
Well, couldn't disappoint...
Introduction
(you can skip this section if you don't care about exposition and/or if you have Tab Explosion Syndrome)
One of the characteristic mechanics of Nethack (and Rogue, and similar... |
Special Independence Day (USA) themed challenge for you today. You must write a program that prints this ascii-art representation of The American Flag.
0
|---------------------------------------------------------
| * * * * * * #################################|
| * * * * * ... |
Introduction
What you have to do is, given an an ASCII diagram of a chemical, output the chemical formula.
Rules
Your code must not access the internet and may not use a stored library of molecules. You may have a library of elements.
You must verify all of the elements included in the formula are real, with all elemen... |
Inspired by Print the American Flag! this is a direct copy but with the British flag as it has some symmetries but is still quite complex!
Your challenge is to produce the following ASCII-Art in as few bytes as possible! Turn your head/screen (not both!) by 90 degrees to view it properly.
_____________________________... |
Squaring the Square is a process of tiling a square using only other squares. If this tiling only uses squares of different sizes, then it is considered to be perfect. The smallest possible perfect squared square is a 112x112 square tiled using 21 different squares.
I have created the ascii art version of this squar... |
As the title suggests, my task is fairly straightforward:
Write a program in your language of choice that will print out the first 20 Fibonacci numbers using the least unique characters.
For example in Python 2:
def fib(n):
a,b = 1,1
for i in range(n-1):
a,b = b,a+b
return a
for i in range(1,21):print fib(i)
... |
The task is simple, post 2 code snippets that perform the same task, where one seems very optimized at first glance, but actually is significantly slower than the other.
Only one rule:
Both snippets must finish with the exact same output (for the same given input, if any).
|
Here we go again! This is my last flag for now!
I originally wanted to do my national flag but I thought the stars were too hard so I posted Print the British Flag! instead, which itself was inspired by Print the American Flag!. This challenge would be better for 3 September (Australian National Flag Day) or 26 January... |
The following is inspired by a question that came up on Stack Overflow today.
Given a number of microseconds, 0 <= n <= 86400000000 (e.g. 12345678900), output a formatted string hh:mm:ss:000:000, e.g. 03:25:45:678:900.
0 -> '00:00:00:000:000'
12345678900 -> '03:25:45:678:900'
86400000000 -> '24:00:00:000:000'... |
It seems flags are a trend now, so what better place to start an account? I thought bars could use a twist to them, so I found this flag.
Produce the following in the console output the fewest possible bytes:
+----------------------------------+
|XXXXX |
|XXXXXXXX |
... |
In the English language, a surefire way to make a pronounceable nonsense letter combination is to make it entirely out of consonant-vowel pairs, e.g., Wu ko pa ha, or, Me fa ro, consonant first, followed by vowel.
Challenge:
Write a program or function that will, given a user-specified number of letters, create a rando... |
A language that is very useful in restricted source and other such challenges is Unary, a brainfuck derivative in which programs are written in with only one character. Your job is to write a program to convert programs from brainfuck to unary and a program to do the opposite, both programs in the same language. Your s... |
The six main cast members of the American sitcom Friends all agreed that they would be paid the same salary throughout the run of the series (after season 2, at least). But that doesn't mean that they all had the same amount of air time or that they all interacted on screen with each other the same amount.
In this chal... |
This challenge was posted on the DailyProgrammer subreddit, and I figured it would be a great candidate for a code golf challenge. Determining if a letter balances is based on its distance from the point of balance, and the letter's value. The value of a letter can be determined by either taking its one-indexed positio... |
Any binary floating point can be formatted exactly in decimal. The resulting string might be somewhat long, but it is possible. In my article on floating point I cover the importance of precision, and now I want this function. This challenge is to write a program, or function, that takes a floating point value as input... |
Incremental Game Time Format
Goal
Incremental games often have a countdown timer expressing the days, hours, minutes and seconds until a task is complete. Depending on the space available, they can be formatted as:
2d 13h
23h 59m 48s
14m
3h 0m 0s
The goal of this code golf is to write a function or program that perfo... |
Introduction
Everyone knows that the possibility of successfully navigating an asteroid field is approximately 3,720 to 1. But despite your warning, Han Solo is still willing to try his luck.
Fearing for your artificial life, you decide to code, in the ship's peculiar dialect (read: your preferred Code Golf language), ... |
Your task to to solve the SLCSC problem, which consists in finding the shortest possible code to solve the Longest Common Subsequence problem.
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.... |
There are 40 ways a directed Hamiltonian path can be arranged on a 3×3 grid:
This graphic (thanks Sp3000!) shows only the 20 undirected paths. Traverse each colored line in both directions for the 40 directed paths.
Challenge
Using only printable ASCII, write a 3×3 grid of characters, such as:
ABC
DEF
GHI
When each o... |
A friend of mine challenged me to write a function that works with both of these scenarios
add(1,2) // 3
add(1)(2) // 3
My instinct was the write an add() function that returns itself but I'm not sure I'm heading in the right direction. This failed.
function add(num1, num2){
if (num1 && num2){
return num... |
This challenge is the second of a series of fastest-code problems that should be written in the GOLF CPU. You can find the first here
For this problem, you are given the volume of a cuboid (A rectangular cube). Each of the side lengths are integers. You must return the number of distinct cuboids that have that volum... |
Given a necklace with color stones (yellow, white, brown, etc.) of at least two different colors, we describe that necklace using letters that correspond to each color, choosing an arbitrary starting point.
We try to answer these questions:
How many distinct colors does the necklace have?
What's the length of the long... |
Introduction
Time is confusing. Sixty seconds to a minute, sixty minutes to an hour, twenty-four hours to a day (and not to mention that pesky am/pm!).
There's no room for such silliness nowadays, so we've decided to adopt the only sensible alternative: decimal days! That is to say, each day is considered 1 whole unit,... |
SPICE is an electrical circuit simulation program originating from UC Berkeley. Your goal is to implement a minimalistic version which can solve for the nodal voltages and branch currents of a circuit composed of resistors and DC current sources.
Input Format
The input may come from a file, io stream, or the nearest eq... |
There is that famous riddle:
A bear walks 1 km south, 1 km east and 1 km north, and comes to the place it started from. What color is the bear?
This one is very old, so I'll generalize it:
A bear walks x km south, y km east and x km north, and comes to the place it started from. This bear thinks that the North Pole ... |
For a fixed n, consider the n by n Toeplitz matrices with entries which are either 0 or 1. The aim is to find maximum determinant over all such Toeplitz matrices.
Task
For each n from 1 upwards, output the maximum determinant over all n by n Toeplitz matrices with entries which are either 0 or 1. There should be one o... |
I define the n-th ternary as a ternary that returns n and has the form:
1 ? 2 ? 3 ? n - 1 ? n : 0 : 0 : 0 # n - 1 zeroes
Write a function or complete program that given an input n will output or return the n-th ternary. Code-Golf.
Testcases
0 #=> undefined behaviour
1 #=> 1
2 #=> 1 ? 2 : 0
3 #=> 1 ? 2 ? 3 : 0 : 0
10 ... |
Antiferromagnetism is what IBM researchers used to jump from a 1 terabyte disk to a 100 terabyte disk in the same amount of atoms.
In materials that exhibit antiferromagnetism, the magnetic moments of atoms or molecules, usually related to the spins of electrons, align in a regular pattern with neighboring spins (on d... |
In Dungeons and Dragons, some of the most important atributes of a character are the ability scores. There are 6 ability scores, for the six abilities. The abilities are Strength, Dexterity, Constitution, Intelligence, Wisdom and Charisma.
When determining the scores for a character, I use the following procedure: Roll... |
On some terminals, pressing backspace generates the control code ^H to delete the previous character. This gave rise to a snarky idiom where edits are feigned for comedic effect:
Be nice to this fool^H^H^H^Hgentleman, he's visiting from corporate
HQ.
Given a string with one or more ^H's, output the result of backsp... |
colors.rgb("blue") yields "#0000FF". colors.rgb("yellowish blue") yields NaN. colors.sort() yields "rainbow"
Using the rules set out in the image and its title text (quoted here), create a program that accepts all the given input and displays the appropriate output.
Input can be taken with stdin or nearest equivale... |
Introduction
The Dragon's Curve is a fractal curve that notably appears on section title pages of the Jurassic Park novel.
It can very simply be described as a process of folding a paper strip, as explained in the Wikipedia article about this curve.
The first few iterations of the generation of this curve look like thi... |
Hexadecimal is a base 16 counting system that goes from 0 to f. Your job is to make a counter that will display these numbers.
Example:
$ python counter.py
1 2 3 4 5 6 7 8 9 a b c d e f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30
Rules:
The numbers may be separa... |
Mahjong is a tile game that is immensely popular in Asia. It is typically played with four players, and the goal of the game is to be the first person to complete a valid hand using the tiles. In mahjong there are three tile suits plus honour tiles — for this challenge we will only consider hands formed using tiles fro... |
MS Paint was always a great time waster, but it was shunned by most graphic designers. Perhaps people lost interest because of the jarring color palette, or because of limited undo levels. Regardless, it's still possible to generate beautiful images with just the standard brush and default color palette.
Challenge
Usin... |
SF(n) is a function which computes the smallest prime factor for a given number n.
We'll call T(N) the sum of every SF(n) with 2 <= n <= N.
T(1) = 0 (the sum is over 0 summands)
T(2) = 2 (2 is the first prime)
T(3) = 5 = 2 + 3
T(4) = 7 = 2 + 3 + 2
T(5) = 12 = 2 + 3 + 2 + 5
...
T(10000) = 5786451
The winner will be the ... |
You are given a list of 2-tuples of positive integers, of the form:
a1 b1, a2 b2, ..., an bn
In other words, the 2-tuples are comma-separated, and the integers within each tuple are space-separated. All of the a numbers are in strictly increasing order, as well as the bs. Your goal is to "fill in the gaps." What is mea... |
I had to write a code for finding all non-empty sublists partitionings of a list:
def f(s):
if s:
for j in range(1,len(s)+1):
for p in f(s[j:]):
yield [s[:j]]+p
else:
yield []
I managed to shorten it (for Python 3.4+) to:
def f(s, p=[]):
if s:
for j in ra... |
Background
After applying the BWT (as seen in Burrows, Wheeler and Back) and the MTF (as seen in Move to the printable ASCII front), the bzip2 compressor applies a rather unique form of run-length encoding.
Definition
For the purpose of this challenge, we define the transformation BRLE as follows:
Given an input string... |
Rod is moderating a card game between two players: George and Tim. Currently, Tim is shuffling the cards. Rod suspects that Tim is trying to cheat, so he needs your help to check that the shuffle is fair.
Tim is doing the overhanded shuffle: he cuts a pile of cards from the bottom of the deck, then cuts various parts f... |
Consider a string of length N, such as Peanut Butter with N = 13. Notice that there are N-1 pairs of neighboring characters in the string. For Peanut Butter, the first of the 12 pairs is Pe, the second is ea, the last is er.
When the pairs are mostly different characters, the string has a chunky quality, e.g. chUnky.
W... |
+--+
+--+ | | +--+ +--+
| | | | | | | |
+--+ +--+ +--+ +--+
The people of ASCIIville are rebuilding their city and are sketching out new blueprints. Your job is to draw their new city based on how many buildings they want.
The input will be how many buildings there are. Each building is half the hight of th... |
It can be in any language, plus the map must be in the output only not in the source code.
This is my first question here, so please feel free to edit it. Also, there might be some rules about scoreboard which I'm not familiar how to put it here.
Cheers!
|
Consider a triangle ABC where each side has integer length (an integral triangle). Define a median of ABC to be a line segment from a vertex to the midpoint of the opposing side. In the figure below, the red line segments represent the medians. Note that any given triangle has three medians.
Let n be some positive int... |
1300 years ago, the English theologian Bede earned the honorific by which he is now known ("The Venerable Bede") by, among other things, convincingly computing the date of Easter for a number of years. This required reconciling the old, Jewish, lunar calendar with the newer solar one, a task made all the more challengi... |
The goal of this challenge is to implement a storage and retrieval pattern that will most quickly determine if a set of recurrence definitions fall within a date range.
Consider the schema: Event -|--has one or many--<- Schedules
Schedule is a record defining a recurrence, e.g. (these are just samples)
Monthly, every... |
Write a program that takes in a string or text file whose first line has the form
width height
and each subsequent line has the form
x y intensity red green blue
where:
width and height may be any positive integers.
x and y may be any integers.
intensity may be any non-negative integer.
red, green, and blue may be a... |
Garland Words
A garland word is a word which can be strung together like a garland, because it ends with the same letters it starts with. These groups of letters can even overlap!
For example, underground is a garland word of order 3, because it starts and end with the same 3 characters, und. This means it could be st... |
Using the following table (source) write some code that takes the names of two planets and returns the distance between them:
+-------------------+---------------+
| Planets | Distance (km) |
+-------------------+---------------+
| Mercury -> Venus | 50290000 |
| Venus -> Earth | 41400000 |
| Ea... |
Given a matrix M all of whose entries are 0 or 1, we want to known whether there exists a non-zero vector v with each element in {-1, 0, 1}, such that Mv = 0.
An easy way to do this is just to try all possible vectors v. The M is m by n then there are 3n - 1 such vectors. But of course this is PPCG, so we don't want... |
Consider 30 by 30 Toeplitz matrices all of whose entries are 0 or 1. This challenge is a simple optimization challenge to find the matrix with the largest determinant possible.
Input None
Output A 30 by 30 Toeplitz matrix all of whose entries are 0 or 1 along with its determinant.
Score The determinant of the matrix y... |
Introduction
In this game, players use their armies to fight other players' armies, capture territories, and become the last man standing. Each turn, players receive a base number of armies to use at their disposal. By capturing territories in certain regions, however, players can increase this number to give them a po... |
Background
PICASCII is a neat tool that converts images into ASCII art.
It achieves different degrees of brightness by using the following ten ASCII characters:
@#+';:,.`
We'll say that these charxels (character elements) have brightnesses from 1 (at-sign) to 10 (space).
Below, you can see the results of converting a... |
This question will feature a mechanic from the game "Path Of Exile" in this game there are things called MAPS they are items that you can use to open high level areas, you can also combine 3 of them to get a upgraded one which will be the task of this challenge. The upgrade combinations are as follow:
A Crypt Map 68 ->... |
An Abjad is a writing system where each symbol stands for a consonant, and where vowels are omitted. An impure Abjad is an abjad in which there are additionals symbols for vowels, usually diacritics.
Write a program or function that, given a string of lowercase text (i.e. nothing but ASCII letters from a to z, commas a... |
In Talos Principle, from time to time player has to solve a puzzle that looks like this:
Source: http://uk.ign.com/wikis/the-talos-principle/File%3A20141108_134749.jpg
This puzzle is already solved - the blue slots on the right are the list of the possible blocks the user could use. They were placed in the grid so tha... |
This is a challenge about the the tricks and optimizations that can be used when golfing in Pyth. Pyth golfers may recognize many of the tricks involved. However, unfamiliar approaches and constructs may be involved, so take a look at the Pyth Tips as well as the Pyth Character Reference if you get stuck. Solutions ma... |
The standard long addition method:
The standard algorithm for adding multidigit numbers is to align the addends vertically and add the columns, starting from the ones column on the right. If a column exceeds ten, the extra digit is "carried" into the next column. (wikipedia)
A long addition example:
145
+ 98
-----
... |
When coding in Python, sometimes you want a multiline string within a function, e.g.
def f():
s = """\
Line 1
Line 2
Line 3"""
(The backslash is to remove a leading newline)
If you try to actually print out s, however, you'll get
Line 1
Line 2
Line 3
That's not what we want at all! There's... |
Given a WxH grid, how many possible mazes are there?
Things you know about the maze:
The grid is exactly H squares high and W squares wide.
There are three types of squares: Start, Finish, and Empty. Your maze must contain exactly 1 Start and 1 Finish, and all remaining squares are Empty.
There are walls surrounding ... |
The SKI calculus is a variant of the Lambda calculus that doesn't use lambda expressions. Instead, only application and the combinators S, K, and I are used. In this challenge, your task is to translate SKI terms into Lambda terms in β normal form.
Input Specification
The input is an SKI term in the following textual ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.