instruction
stringlengths
34
53.1k
Inspired by this challenge. Goal: Given a pre-configured switchboard and a list of indexes, invert the switches at the given indexes. A switchboard is made up of some number of switches (v or ^) wrapped in -'s and arranged into rows of varying length. Here is an example switchboard: -v-^-v- -^-v- -v-^-v- To invert/fli...
Inputs: current hour: from 0 to 23 (inclusive) delta of hours: [current hour] + [delta of hours] = withing the range of Integer Output: delta of days: the value which shows difference in days between day of current hour and day of sum [current hour] + [delta of hours] Scoring Answers will be scored in bytes with ...
Given a two dimensional matrix of 0 and 1s. Find the number of island for 1s and 0s where neighbours are only in the horizontal and vertical. Given input: 1 1 1 0 1 1 1 0 output = 1 1 Number of 1s island = 1 xxx- xxx- Number of 0s island = 1 ---x ---x ------------------------------ Given input: 0 0 0 0 1 1 1 ...
Let us say that we have a particular set of functions on strings. These functions are kind of like fill in the blanks or madlibs, except that they only take one input and use that to fill in all of their blanks. For example we might have a function that looks like I went to the ____ store and bought ____ today. If w...
There is a rectangular 2D array containing viruses denoted by 'v', antidote1 denoted by 'a', and antidote2 denoted by 'b' (there are no values other than 'v', 'a' and 'b'). Antidote1 can kill neighboring viruses in horizontal and vertical directions only, but antidote2 can kill neighboring(if any) viruses in horizontal...
Given an addition pyramid \$P\$, determine whether it can be solved. An addition pyramid consists of layers, each having one number less than the one below it. Layer \$i\$ is symbolized as \$P_i\$. \$P_1\$ is the base layer, and \$P_{i+1}\$ is the layer atop \$P_i\$. The \$j\$th number of \$P_i\$ is denoted as \$P_{i,j...
It's simple, simply write the shortest code to raise a TypeError. In Python you can do: raise TypeError However it should be shorter with a code that gives a TypeError without raising it.
Sandboxed Given a set of closed non-overlapping 2d contours (separated by at least one space even on diagonals) with arrows oriented consistently in the same clockwise or counter-clockwise direction (each contour has its own direction) and a positive number n, move the arrows n steps along the contours in the respectiv...
Super simple challenge today, or is it? I feel like we've heard a fair bit about double speak recently, well let's define it in a codable way... Double speak is when each and every character in a string of text is immediately repeated. For example: "DDoouubbllee ssppeeaakk!!" The Rules Write code which accepts one ...
This challenge has ended. To see the final scores of the competitors, click here In this challenge, each submission is one bot. Each bot should be a Javascript function. Bots will fight to obtain the highest total worth in gold. Gold can be farmed, or earned from killing other bots, and is used to upgrade healing, at...
Introduction Formula One is a complex sport and as with complex sports, strategy is very important.Some teams will manage better strategy than others and those teams will often win the races. After last weekends' amazing German GP, which saw last years Champion Lewis Hamilton pit 6 times (in comparison, some races just...
Challenge I think everyone of us heard of URL encoding mechanism - it's basically everywhere. Given an URLEncoded string on stdin, decode it, and output the decoded form to stdout. The encoding is very simple, + or %20 is representing space. Every percent followed by two hex digits (uppercase or lowercase) has to be re...
Create a quine that cannot be golfed. Your score is your byte count, where higher is better. If someone finds a shorter version, their score is your original byte count, and you lose points Scoring example: original submission, 34 bytes // score is 34 function(this){self.printquine();} golfed, 31 bytes ...
Write a regex that only matches valid country code top level domains (ccTLDs). Your regex must match both the domains with the dot and without the dot (it must match tv and .tv). Any domain that is not a ccTLD or does not exist (e.g. .info or .jobs or .xz) must not be matched. Use Perl, POSIX, PCRE or Python. For refer...
A grid-filling meander is a closed path that visits every cell of a square \$N \times N\$ grid at least once, never crossing any edge between adjacent cells more than once and never crossing itself. For example: Once filled, each cell of the grid can be represented by one of the following 8 tiles: Numbered this way, ...
The height of a binary tree is the distance from the root node to the node child that is farthest from the root. Below is an example: 2 <-- root: Height 1 / \ 7 5 <-- Height 2 / \ \ 2 6 9 <-- Height 3 / \ / 5 11 4 <-- Height 4 Height of binary ...
Not to be confused with Find the factorial! Introduction The factorial of an integer n can be calculated by $$n!=n\times(n-1)\times(n-2)\times(...)\times2\times1$$ This is relatively easy and nothing new. However, factorials can be extended to double factorials, such that $$n!!=n\times(n-2)\times(n-4)\times(...)\times4...
Given a black and white image with a white background and a set of black dots, paint a set of white pixels red, such that there is a path between each pair of black pixels. Details A path is a set of connected pixels (8-neighbourhood connectivity). Black pixels can be used as part of the paths. The goal is trying to ...
(Inspired by the first problem solved in Stanford’s advanced data structures course.) Despite the academicese-heavy name, the problem we're going to solve is almost unbearably simple. We have a list of numbers. [31, 41, 59, 26, 53, 58, 97] We're going to cut some contiguous snippet out of that list of numbers. [31, 41...
For each node in a balanced binary tree, the maximum difference in the heights of the left child subtree and the right child subtree are at most 1. The height of a binary tree is the distance from the root node to the node child that is farthest from the root. Below is an example: 2 <-- root: Height 1 ...
Task: Consider the problem: "given a chessboard with one square missing, cut it into 21 L-triominoes". There is a well-known constructive proof that this can be done for any square chessboard size that is a power of two. It works by splitting the chessboard into a smaller chessboard with the hole in it and one big trio...
Introduction Given this visualization of a playing field: (0,0) +----------------------+(map_width, 0) | A | |-----+-----------+----| | D | W | B | |-----+-----------+----| | C | +----------------------+(map_width, map_height) (0, map_height) The entire map the game is ...
In an earlier challenge I asked code golfers to produce strings which copy each character in a string. For example: TThhiiss iiss ddoouubbllee ssppeeaakk!! This challenge is simply to detect if some text meets the definition of a double speak string. There is an even number of characters. When split into pairs, ev...
Introduction: Beckett Grading Service (aka BGS), is a company which encapusulates and grades Trading Card Game (TCG) cards (i.e. sport cards, Magic The Gathering, Pokémon, Yu-Gi-Oh, etc. etc.). The TCG cards that come in for grading will be checked on four categories (which we will later refer to as subgrades): centeri...
A variable-length quantity (also referred to as VLQ or uintvar) is a way to encode up to a 28 bit integer value using only as many bytes as necessary. This was used in MIDI file format as a way to minimize the size of certain event data. The way it works is fairly simple. As a big-endian series of bytes, the most sign...
Note: This is the radiation-hardening version of my previous challenge Pristine Bit Checking. This should be much more difficult than that one. Write a program/function that takes two integers in the range \$0\$ to \$255\$ inclusive, and returns whether the binary forms of the numbers are exactly one bit different. Fo...
This puzzle is based on this Math.SE post. A more complex version of this problem can be found over here. Assume I have some number of black shirts and some number of white shirts, both at least 1. Both colors of shirt have a non-zero durability. All shirts of a given color start with the same durability. Every day, I ...
This is a more complicated version of this puzzle. The premise is the same but a few rules differ in a few key places, making for a more complex problem. Assume I have some number of black shirts and some number of white shirts, both at least 1. Both colors of shirt have a non-zero durability. All shirts of a given col...
We've all done it, well, maybe not, but making your own alien language and numbering system is a staple of especially fantasy writing, but is mostly just a fun activity. The task is simple, take two inputs: An ordered list input of 10 [ten] unique 'numerals' (any printable ASCII character) and interpret them, in order...
This challenge is based on a video in which Andrew Huang discusses unusual time signatures... https://www.youtube.com/watch?v=JQk-1IXRfew In it, he advises that you can understand time signatures by dividing them into 3's and 2's. So you count to a small number a few times, instead of counting to a large number. Here's...
Create a function that takes in a generator function as its only parameter, and returns an object that can be used as both as a generator and a generator function for said generator. The idea is to be able to create an object that behaves like a generator (that is, it follows the iteration protocols) but also has the a...
Determining whether a Turing machine halts is well known to be undecidable, but that's not necessarily true for simpler machines. A Foo machine is a machine with a finite tape, where each cell on the tape has an integer or the halt symbol h, e.g. 2 h 1 -1 The instruction pointer starts by pointing to the first cell: 2 ...
This is my first attempt at a Code Golf question. If it needs obvious edits, please feel free to make them. Below is a description of the basic Dropsort algorithm. Dropsort is run on a list of numbers by examining the numbers in sequence, beginning with the second number in the list. If the number being examined is l...
The task is simple. Write an interpreter for the language *. Here's a bigger link to the wiki. There are only three valid * programs: * Prints "Hello World"  *  Prints a random number between 0 and 2,147,483,647 *+* Runs forever. The third case must be an infinite loop according to the specifications in this question...
Create a program that interprets the programming language Bucket. Bucket works on two buckets: the first can hold A and the second can hold B units of liquid. The things you can do with these buckets are: f: fill bucket A F: fill bucket B e: empty bucket A E: empty bucket B p: pour units of liquid from A to B until one...
It's August 10th, 2019, but your task still involves Y2K. Weird, right? Create a program that prints itself, with a two digit number appended to it. The first time you run it, it should append 00 to its output (its source code, because this is a quine variant). When you run that output, the original program without a t...
At 1998, Brian Kernighan, while working on the book "The Practice of Programming", wanted to demonstrate realisation of regular expression engine. But struggled to find small engine, that cod could fit in the book. So Brian Kernighan asked Rob Pike to write one for him, and Rob did it gracefully. Here is original sourc...
Write a program that, for the numbers 1 through 255, prints out BF code that will produce the given number in some byte of the array, plus a newline. For example, the first four lines of the output could (and most likely will) be: + ++ +++ ++++ The winner will be the smallest: source code + output (in bytes). Clarific...
Create a cat program, a.k.a a program that takes an input and prints it. ...Except, the program will randomly take characters away from your input and print that instead. Each character in the input should have generally equal odds to be removed with the program, though, as it is hard to make that, the odds for each ch...
Write a program that prints an associative array (key-value) to a table. Requirements Standard loopholes are forbidden Please include a link to an online interpreter and the byte count in the answer Use box drawing characters to draw the table. You can write both a full program or a function. Key or value can't cont...
Inspired by Is it double speak?, I devised a harder challenge. Given a string, determine if the string is n-speak, for any \$n\geq 2\$. N-speak is defined by repeating each letter \$n\$ times. With \$n = 4\$, the string Hello is transformed to HHHHeeeelllllllloooo. Your goal is to figure out if the input is a valid out...
How, you can’t remember the 6 or 7-digit phone number that appeared on the TV screen for a second?! Using the special technique described below, you will turn into a walking phonebook! Obviously, the number 402 is easier to remember than the number 110010010, and the number 337377 is easier to remember than the number ...
Crossing Sequences Given a list of positive integers A, call it an increasing sequence if each element is greater than or equal to the previous one; and call it a decreasing sequence if each element is less than or equal to the previous one. Some increasing sequences: [1,2,4,7] [3,4,4,5] [2,2,2] [] Some decreasing seq...
Goal Write a program or function that translates a numerical telephone number into text that makes it easy to say. When digits are repeated, they should be read as "double n" or "triple n". Requirements Input A string of digits. Assume all characters are digits from 0 to 9. Assume the string contains at least one cha...
"A picture is worth a thousand words"—so the old saying goes. The average word is about four characters long, so a picture conveys 4kB of information. But how much entropy, rather than information, can a picture convey? Your task is to generate an image, exactly 4,000 bytes in size, with the highest entropy possible. Y...
Língua do Pê, or P Language, is a language game spoken in Brazil and Portugal with Portuguese. It is also known in other languages, such as Dutch and Afrikaans. (Wikipedia) There are some dialects in this language game. The different languages the game is played with even have their own unique dialects. Some people are...
I have a list of decimal digits: 4, 4, 4, 7, 7, 9, 9, 9, 9, 2, 2, 2, 4, 4 The list of decimal digits are known as items. We can form "chunks" from these items by grouping together identical and adjacent numbers. I want to assign each chunk a unique number, starting from 1, and increasing by 1 in the order the chunks ap...
Here is a relatively simple two dimensional array challenge. Imagine a battlefield of 625 foot soldiers. You command the odd troops, but unfortunately the strength of the even troops overwhelms you. Thankfully, your soldiers have a secret power: If the power of each odd troop and the fellow odd allies surrounding them ...
Instead of being a skillful warrior capable of slaying Hydras (see here and here), this time you are a warrior that has no prior knowledge on how to kill one or which weapons to use against the creature. In this problem, whenever you cut a single head off, two will grow in the same place. Since you don't have the mech...
This task is simple: Write a program or function that outputs the list of all musical notes (using English note names) from A♭ to G♯. All notes without a name consisting of a single letter (i.e. black notes on a musical keyboard) should have their name printed twice, once as the sharp of a note, once as the flat of one...
A sentence of number theory (for our purposes) is a sequence of the following symbols: 0 and ' (successor) - successor means +1, so 0'''' = 0 + 1 + 1 + 1 + 1 = 4 + (addition) and * (multiplication) = (equal to) ( and ) (parentheses) the logical operator nand (a nand b is not (a and b)) forall (the universal quant...
You are given two integers between lets say 1 and 12, one and two and a integer between lets say 0 and 4 which is called range. The challange is to decide if one is inside or equal the range from two ± range. The range is restarting with 1 after 12 and vise versa. For example, if one = 2, two = 11 and range = 3, t...
Any two separate nodes in a binary tree have a common ancestor, which is the root of a binary tree. The lowest common ancestor(LCA) is thus defined as the node that is furthest from the root and that is the ancestor of the two nodes. The following are binary trees and the lowest common ancestors of the some of their n...
Your task is to remove smallest amount elements from a list, so the most elements are on their corresponding place. The element is on it's corresponding place, when it's value is equal to it's position. Let's look at this example list: 1 5 3 2 5 This list has three elements on their corresponding place (1 on position ...
I was going through a bizarre thread on Reddit, and came across this: ( ͡°( ͡° ͜ʖ( ͡° ͜ʖ ͡°)ʖ ͡°) ͡°) It's representing a group of people smiling somewhat suspiciously. (In the challenge below though, spaces to the left of the right eyes were dropped somehow while I was writing the challenge. Note the spec). Your goa...
A theorem in this paper1 states that every integral n-by-n matrix M over the integers with trace M = 0 is a commutator, that means there are two integral matrices A,B of the same size as M such that M = AB - BA. Challenge Given an integral matrix M with trace M = 0 find some integral matrices A,B such that M = AB - BA....
With challenges like Output with the same length as the code and Create output twice the length of the code, I thought of a separate, but similar challenge. The task is to produce an output. It can either be a string, a list of characters, or whatever is the default output format of your program. However, your output ...
There's a minigame in Super Mario 3D World known as the Lucky House. It consists of a slot machine with 4 blocks. Each block may be one of 5 different icons (Flower, Leaf, Bell, Cherry or Boomerang) and the goal of the player is to get as many identical icons as possible (see a video). The player is rewarded with coin...
Most square numbers have at least 1 different square number with which their Levenshtein distance is exactly 1. For a given square \$x\$, each square that meets this condition is called a Levenshtein neighbour of \$x\$. For example, \$36\$ is a Levenshtein neighbour of \$16\$, as only 1 edit (\$1 \to 3\$) is required. ...
Posted from here. This challenge is highly "distilled" from this question. Special thanks to @Akababa! In this task, you should insert an exclamation mark at the start of the string and after every character. Rules There will always be a non-empty-string input. The input will not contain tabs either. You can assume th...
Background Joe is working on his new Brainfuck answer on Codegolf. The algorithm he's using to solve the challenge is a bit complicated, so Joe came up with idea of simplifying his Brainfuck notation to make programming easier and faster. The challenge Let's look at snippet written by Joe a moment ago: 0+++++1+++++0[3+...
The task is to write a radiation-hardened irradiator. What do I mean by that, exactly? An irradiator is a program that, when given a string as input, will output all possible versions of the string with one character removed. For example, given the input Hello, world!, the program should output: ello, world! Hllo, worl...
You’re given two \$r×c\$ grids. Each cell contains either 0 or 1. What are the minimum number of swaps (between horizontally and vertically adjacent cell elements, no wrapping i.e no swapping between last and first element of a row) are required in the first grid for it to match the second. If the matched arrangement c...
Write a function or program that takes two words as input and outputs variants of the popular English tongue-twister "How much wood would a woodchuck chuck if a woodchuck could chuck wood?". The output will use the first word four times How much wood would a woodchuck chuck if a woodchuck could chuck wood? and the se...
Church booleans A Church boolean is a function that returns x for true and y for false where x is the first argument to the function and y is the second argument to the function. Further functions can be composed from these functions which represent the and not or xor and implies logical operations. Challenge Construct...
The Typical Way to Make an Acronym Out of a Phrase Is to Take the First Letter of Each Word: TTWMAOPITFLEW. howeveR, sometimEs, you can make an acronym of random leTters In a seNtence such As like this: RETINA. The only condition is that the letters have to be in the correct order. For instance: LORD can be acronymise...
The challenge Given two strings, each of length up to 30, consisting of printable ASCII characters (codes \$[32, 126]\$), put them onto a balance scale in the fewest bytes of code! This consists of the following steps: Calculate and compare the weights of the strings Choose the appropriately tilted ASCII-art scale Pla...
let S, a and b each represent a string Goal: Write a standard string replace function where the you replace all occurrences of a in a string S with b so long as a is not already part of an instance of b for example, if we have the string S = My oh my that there is a big ol' that and we wanted to do a fancy replace with...
Given a strictly positive integer n, follow these steps: Create an array A with n 1s. If A only has one element, terminate. Otherwise, starting from the first element, replace each pair of A with its sum, leaving the last element as is if A's length is odd, and repeat this step. The output should contain A's state af...
Challenge Write a program that takes as input a day from April 30, 1789 to August 21, 2019 and returns as output who was president of the USA that day. Notes For the list of US presidents, the format of their names, and the period of their presidency, see below: April 30, 1789 - March 4, 1797 George Washington...
Introduction Recently, me and a couple of my friends decided to play some cards, and one of them suggested the game 'Irish Snap', which was the inspiration for this challenge. However, I later learnt that the game has a lot of different rules that you can play with, some of which are listed here. The rules that are in...
Randomly inspired by Numbers Increase While Letters Decrease Given a list of mixed letters and integers (e.g., ['a', 2, 3, 'b']) increase the letters by one position in the alphabet (wrapping at z to a) and decrease the numbers by 1. For the above example, the output should be ['b', 1, 2, 'c']. The input can be a mixe...
This is a simple task. Given a positive or negative real number, round it to the next whole integer closer to zero. The challenge Take input through any reasonable form (stdin, function, etc.) of one positive or negative real number. Round this number "towards zero" - this means if it is positive you will round down,...
Winner found It seems as if we have a winner! Unless anyone plans on contesting the world's current fastest Sudoku solver, user 53x15 wins with the staggeringly fast solver Tdoku. For anyone still working on their solvers, I'll still benchmark new submissions when I have time. The challenge The goal of a game of Sudoku...
Disclaimer: ModTen is a fictional card game which was created for the sole purpose of this challenge. The rules of ModTen ModTen is played with a standard 52-card deck. Because the full rules are yet to be invented, we're going to focus on the hand ranking exclusively. A winning hand in ModTen. Graphics from Wikipedia...
And then the King said: You fought bravely, Knight, and your deed will not be forgotten for centuries. For your valor I grant you this castle and the lands around it. Things rush me, and I can not take you to the castle. Therefore, I will give you the way from this place to the castle. Now go and come back after the de...
Church Subtraction Lambda calculus has always been a fascination of mine and the emergent behaviors of passing functions into each other is delightfully complex. Church numerals are representations of natural numbers contructed from the repeated application of a function (normally the unary addition of a constant). For...
Given a string, replace all left-double-quotes into two backticks and all right-double-quotes into two single-quotes. Left-quotes means the quotes that starts a quote. Right-quotes means the quotes that ends a quote. Quotes cannot be nested. You may assume that there are an even number of double-quotes in the string. E...
"Talk" is a baroquified accumulator-based language that is created in response to Dennis's quote on talk.tryitonline.net. Waiting for someone to create an esolang called talk. . The "Talk" language has 4 commands: 00 If the accumulator is 0, set the accumulator to 0. 01 If the accumulator is 0, set the accumulator t...
Given the 2-dimensional positions and velocities of a pair of billiard balls right before impact, calculate their velocities after a perfectly elastic collision. The balls are assumed to be ideal spheres (or equivalently: circles) with the same radius, same mass, uniform density, and no friction. Input consists of 8 nu...
You have locked your bike with a combination lock of 3 digits. Now you want to go for a ride and need to unlock it with the help of following program. Input 1st parameter The digit combination of your lock in locked state. It must be different from the 2nd parameter (=the combination of unlocked state). (Or else your b...
This code challenge will have you compute the number of ways to reach \$n\$ starting from \$2\$ using maps of the form \$x \mapsto x + x^j\$ (with \$j\$ a non-negative integer), and doing so in the minimum number of steps. (Note, this is related to OEIS sequence A307092.) Example So for example, \$f(13) = 2\$ because t...
Programming problem: In BotLand, Robots can understand all words of any combination of letters and letters with leading or trailing (not both) numeric value. Given a word W (string of alphanumeric). Write a function to check if W is Bot word. Don't use library functions/ regex. Example: Input: BotLand Output: Bot word ...
Wholly surprised this hasn't been posted already, given the large number of chess puzzles on the site. While I thought of this myself, credit to Anush for posting it to the sandbox back in March. But I figured it's been long enough that I could go ahead and do so myself. A checkmate in chess is a position in which the ...
Given a list of positive integers, find the number of triangles we can form such that their side lengths are represented by three distinct entries of the input list. (Inspiration comes from CR.) Details A triangle can be formed if all permutations of the three side lengths \$a,b,c\$ satisfy the strict triangle inequal...
In this task, you will write a program/function that takes a Normalized Malbolge program and outputs the resulting Malbolge program. (This is a secret tool that all Malbolge programmers are using!) Input A data structure that (somehow) represents a Normalized Malbolge program. Output A data structure that represents th...
What general tips do you have for golfing in Smalltalk? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Smalltalk (e.g. "remove comments" is not an answer). Smalltalk is a purely object-oriented language created by Alan Kay. The two links are GNU Small...
Bowl Pile Height The goal of this puzzle is to compute the height of a stack of bowls. A bowl is defined to be a radially symmetric device without thickness. Its silhouette shape is an even polynomial. The stack is described by a list of radii, each associated with an even polynomial, given as input as a list of coeff...
Snaking Number Challenge I wonder how many snaking numbers there are between 1 and 50,000? Snaking Numbers, in this game, are numbers which can be typed out on a traditional numberpad (format below) by moving one key up, down, left, or right. 7 8 9 4 5 6 1 2 3 0 For example, if you start with the number 5, you could...
Rules: Your program must print "hello world" when executed Your program must be interpretable or compilable into 2 or more languages Your program must require no input or arguments Languages with identical syntax are too easy, and will be shunned. We all know you can write echo hello world in Bash and Batch, so let's ...
The Blow-up is a powerful tool in algebraic geometry. It allows the removal of singularities from algebraic sets while preserving the rest of their structure. If you're not familiar with any of that don't worry, the actual computation is not difficult to understand (see below). In the following we are considering the ...
Background Malbolge is truly intriguing language. But programs written in it are also extraordinairly huge (and in some cases, unpostable on PPCG). Your challenge (shall you accept it) is, to compress and decompress given normalized Malbolge program. Devise your own lossless algorithm. You may compress your data furthe...
Landau's function \$g(n)\$ (OEIS A000793) gives the maximum order of an element of the symmetric group \$S_n\$. Here, the order of a permutation \$\pi\$ is the smallest positive integer \$k\$ such that \$\pi^k\$ is the identity - which is equal to the least common multiple of the lengths of the cycles in the permutati...
You have a bunch of heavy boxes and you want to stack them in the fewest number of stacks possible. The issue is that you can't stack more boxes on a box than it can support, so heavier boxes must go on the bottom of a stack. The Challenge Input: A list of weights of boxes, in whole kg. Output: A list of lists describi...
We've all been told at some point in our lives that dividing by 0 is impossible. And for the most part, that statement is true. But what if there was a way to perform the forbidden operation? Welcome to my newest creation: b-numbers. b-numbers are a little bit like imaginary numbers: the main pronumeral involved repre...
There is a sentence with many cats: there is a cat house where many cats live. in the cat house, there is a cat called alice and a cat called bob. in this house where all cats live, a cat can be concatenated into a string of cats. The cat called alice likes to purr and the cat called bob likes to drink milk. The Task ...
Given a position with a row of rooks and/or empty spaces, output how many different rook moves are possible. A rook can move left or right to an empty space, but not to one that requires passing over another rook. When a rook moves, the other rooks remain in place. For example, from this position, 6 moves are possible:...
Given a string ending in either "er", "ir", or "re" (the "infinitive"), output the full conjugation of the string as a French verb in the seven simple tenses. For each tense (in the order given below), output each subject pronoun in the following order: je, tu, il, elle, nous, vous, ils, elles; followed by a space, the...
Farkle Fest 2k19 In this challenge, we will be playing the semi-popular dice game Farkle. Farkle is a dice game that has players selecting to save dice or risk rerolling the die for more points to add to their total. Players should use probability, game-state considerations and opponent tendency to make their decisions...
Given a single letter from A to Z (except J and K) as input, output the smallest non-negative integer containing that letter in its written form. Assume numbers never contain the word "and", so 101 is "one hundred one", not "one hundred and one". Assume American (short-scale) counting, so one million is 10^6 and one bi...