instruction
stringlengths
34
53.1k
disclaimer: I'm not aware of any non-bruteforce solutions A Graeco-Latin square is, for two sets of same length \$n\$, a \$n \times n\$ arrangement of cells, each containing a unique (across the entire square) pair of a element of the first set and a element of the second set, such that all first elements and all sec...
Challenge: Given a list of multi-line strings, overlap them (in the top-left) and output the result. Example: Input: ["aaaa\naaaa\naaaa\naaaa","bb\nbb\nbb","c"] Output: cbaa bbaa bbaa aaaa Challenge rules: Input-format is flexible. You are allowed to get the input as a 2D list of lines (i.e. [["aaaa","aaaa","aaaa","a...
Background There are self-extracting .ZIP files. Typically they have the extension .EXE (and by executing the file they will be extracted) but when renaming them to .ZIP, you can open the file with some ZIP extracting software. (This is possible because .EXE files require a certain header but .ZIP files require a certa...
Introduction: I collect twisty puzzles. Most twisty puzzles are produced and sold by Chinese companies. Most well-known companies ask permission from puzzle designers to produce their designs and work together towards a product on the market. In this case, puzzle designers are of course very happy and proud that one of...
The Steenrod algebra is an important algebra that comes up in algebraic topology. The Steenrod algebra is generated by operators called "Steenrod squares," one exists for each positive integer i. There is a basis for the Steenrod algebra consisting of "admissible monomials" in the squaring operations. It is our goal to...
This code golf challenge is to show directions through numbers. When the user enters a number, then that means a direction change as follows: 0 means stay still 1 means forward (initially from left to right and initially start with `:`) 2 means turn right 3 means turn left 4 means go backward I will show you an exampl...
Challenge Bar Dice is a simple game played in a Bar with Dice (hence the name). You roll 5 six-sided dice and attempt to make the best hand. Scoring is based on amassing the largest number of dice with the same digits. Each hand must include at least a single "Ace", or one, in order to be a valid hand; Aces act as "w...
Here's yet another Steenrod algebra question. Summary of the algorithm: I have a procedure that replaces a list of positive integers with a list of lists of positive integers. You need to repeatedly map this procedure over a list of lists and flatten the output until you reach a fixed point. Then for each sublist, if i...
Not exactly sure if it belongs in this site, but I always have trouble thinking of all the certain edge cases in any kind of competitive programming or puzzles. For example, take this kind of problem Find the size of the smallest list of squares that add up to n f(16)-> 1 (16) f(17)-> 2 (16+1) One intuitive approach ...
JonoCode9374 had almost completely implemented my language EnScript except for the CHS command. I was impatient of waiting for them to implement this command, so I chose to put this question here. Challenge: Write a solution that takes an input and returns the chased output. Standard loopholes are forbidden. This is th...
The aim of this challenge is to find an impossibly short implementation of the following function p, in the langage of your choosing. Here is C code implementing it (see this TIO link that also prints its outputs) and a wikipedia page containing it. unsigned char pi[] = { 252,238,221,17,207,110,49,22,251,196,250,2...
I suspect Gomoku may be one of the simplest games to implement in code. https://en.wikipedia.org/wiki/Gomoku The game is this: players BLACK and WHITE take turns putting down black and white stones. Black traditionally goes first. If, when a player puts down their stone, they now have 5 in a row of their color, they wi...
Write a program that reads a string, and inserts commas to divide large numbers in groups of 3. i.e. 10000 => 10,000. It should 'fix' incorrectly formatted numbers as described below. It must work for all numbers on the same line It should not modify numbers after a decimal point. i.e. 1234.5678 => 1,234.5678 Leading...
A magic word is a word whose Braille spelling contains precisely 26 dots (because the Morse code alphabet can be circularly encoded within). For example: ⠎ ⠝ ⠥ ⠛ ⠛ ⠇ ⠽ snuggly ⠏ ⠕ ⠇ ⠽ ⠛ ⠕ ⠝ polygon ⠝ ⠥ ⠛ ⠛ ⠑ ⠞ ⠽ nuggety ⠽ ⠕ ⠛ ⠓ ⠥ ⠗ ⠞ yoghurt are all magic words. Objective: Craft a program to identify 77 such mag...
Specifications Given a number n, output an ASCII "meme arrow" (greater-than symbol, >) of size n. n will always be a positive integer, greater than 0. Examples n = 2 \ \ / / n = 5 \ \ \ \ \ / / / / / Sample code Here is a sample program, written in Crystal, that returns the correct results. Run...
Gimbap(김밥) is Korean food, somewhat looks like sushi roll. Here is Korean emoticon represent Gimbap : @)))))))))) Your quest is make ASCII Gimbap cutter. Rule Input is string made with only @ and ). Output cuts every valid Gimbap with ), and then add @ between them. So for example @)) to @) @). Valid Gimbap starts wi...
Challenge Given a 2D array, find the length and direction of all the longest consecutive characters. If there are ties, output every possible winning combination in any order, (winners can overlap with other winners) Zero "0" is a special padding character which cannot be a winner. Code golf rules apply, shortest code...
This challenge is inspired by a series of young children's books by Fiona Watt and Rachel Wells, which I've recently been enjoying with my daughter. In each book a mouse (illustrated, but not part of the text) complains that a succession of 5 things of the same type are not its thing. It then backs this up by declarin...
This seems almost trivial, but since after some effort I was not able to beat the literal solution in J, I thought it might make a decent challenge (though, to be clear, this is not a J-specific challenge). Title says it all. You simply need to write a program, or function (taking no arguments) that returns or prints:...
Make a Number Expression is related : actually, it is also about Aheui. But it just made number expression, but this made real Aheui code. Aheui is esolang written in only Korean character. Because of its nature, Aheui can't use Arabic numbers. But, of course, there is way to generate number. Brief introduction to Ahe...
Reading the text of the millitext font There is a font here that fits each character into a single, 1x5 pixel block. It does this (assuming you're using an LCD screen) by using the RGB channels of each pixel to expand the one pixel into three subcolumns, one for each channel. Your task is to take in a string of text en...
You are tasked with displaying the string "ABCDEFGHIJKLMNOPQRSTUVWXYZ" and only that, except for trailing newlines if they're unavoidable. You must not output any homoglyphic characters like Cyrillic A. You can use non-Unicode encodings, but just to be sure, only output the Latin letters. Regardless of the encoding you...
This is an answer-chaining challenge relating to the OEIS. Oh, the justification for this is because a company needs one program to print out their OEIS sequences real bad and they have every language. The answer-chaining format works in the following way: Someone posts the first answer, from which all further solution...
Output the Nth term of the Van Eck Sequence. Van Eck Sequence is defined as: Starts with 0. If the last term is the first occurrence of that term the next term is 0. If the last term has occurred previously the next term is how many steps back was the most recent occurrence. https://oeis.org/A181391 https://www.you...
The Nonary Game is a fictional game played in the video game trilogy of the same name. Your goal is to find how many players (at best) can escape a given game, in as few bytes of code as possible. Rules of the game There are 9 players, numbered 1 to 9. All players start in the same room. There are any number of doors,...
Unless you have a userscript that modifies the site's design (or even if so), you should have noticed that we have our site design! (It's November now) So, to celebrate, let's make a program that retroactively applies this design (oversimplified, of course)! So, the most important changes are: our new name is now Code...
Print the phrase And she said, 'But that's his.' using only the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ No punctuation or non-alphabetic characters whatsoever. You can use whatever programming language you want. Whitespace is completely allowed. Shortest program wins.
The narcissist is a program which, given its own source as input, prints a truthy value and, given anything other than that, prints a falsey value. Today, we're reversing this. Create a program that, given the name of whatever your language's truthy value is (True, true, 1), prints its own source. Given the name of wha...
Given two contiguous shapes of the same area, determine the optimal way to divide the first shape into a minimum number of contiguous segments such that they can be rearranged to form the second shape. In other words, find the minimum number of segments required that can form both of the shapes. "Contiguous" means that...
Create a program that, given an integer N, outputs the number of years we have to get to N A.D. or how many years it has been since N A.D, as a string or int. For example, given 2014, the program should output 5 as it has been that many years since 2014. Input of the year in which you run the program should result in 0...
Make a program that outputs the number of seconds from the beginning of today (00:00:00 of the day you run it) to the second you ran it. However, if this number is divisible by three, print Fizz instead. If it is divisible by five, print Buzz instead. If it is divisible by three and five, print FizzBuzz. Don't pad the ...
In the board game Pandemic, an outbreak occurs when a city contains more than 3 disease cubes. When the outbreak occurs, any disease cubes in the city in excess of 3 are removed, and each city connected to it gains one disease cube. This means that chain reactions can, and will occur. Important note: Each city may onl...
The Sixers sequence is a name that can be given to sequence A087409. I learned about this sequence in a Numberphile video, and it can be constructed as follows: First, take the multiples of 6, written in base 10: 6, 12, 18, 24, 30, 36, ... Next, concatenate the numbers into a stream of digits: 61218243036... Finally, r...
Make a snake fill any maze (until it gets stuck). The snake The snake starts at a given starting point, pointing EAST. It moves by always having a wall or a part of its body immediately to the LEFT of its head ("left-hand rule wall follower"), until it gets stuck because all four directions around its head are occupied...
The new site header has some bits of source code from various questions as the background. Here are the first 3 lines: --<-<<+[+[<+>--->->->-<<<]>]<<--.<++++++.<<-..<<.<+.>>.>>.<<<.+++.>>.>>-.<<<+. Hello, World! IT'S SHOWTIME TALK TO THE HAND "Hello, World!" YOU HAVE BEEN TERMINATED "9!dlroW ,olleH"ck,@ 72a101a+7aa+3a4...
Given a grid of directions and a start and end position, determine the minimum number of substitutions in the direction grid that needs to be made to complete the path between the two points. The grid is doubly-cylindrical. This is clearer given an example. Example Let's take the following grid as an example: >>>>v >>>...
What is the best BrainFuck code (in terms of code size) to print 'A' 1000 times ? My approach is: set 'A' to p[0] set 255 to p[1] to display 255 'A', 3 times set 235 to p[1] to display 235 'A' This is not effective but I cannot find a way to use tow counters simultaneously like a multiplication Is there a better appr...
Rules In this challenge, I'm going to redefine the definition of "quotes" a bit. Quotation marks (AKA quotes) are any identical characters used in pairs in various writing systems to set off direct speech, a quotation, or a phrase. The pair consists of an opening quotation mark and a closing quotation mark, which is t...
A traveler needs to stay for n days in a hotel outside town. He is out of cash and his credit card is expired. But he has a gold chain with n links. The rule in this hotel is that residents should pay their rent every morning. The traveler comes to an agreement with the manager to pay one link of the golden chain for e...
Challenge: Given an NxN matrix where \$N\geq2\$ and one of eight distinct 'folding options', output a 2D array/list with the subtracted values. The eight folding options are: left-to-right; right-to-left; top-to-bottom; bottom-to-top; topleft-to-bottomright; topright-to-bottomleft; bottomleft-to-topright; bottomright-t...
You are given a string, which will contain ordinary a-z characters. (You can assume this will always be the case in any test, and assume that all letters will be lowercase as well). You must determine how many unique combinations can be made of the individual characters in the string, and print that number. However...
Introduction In a general election, one would like to calculate a constant price per parliament seat. This means that for N >= 0 seats to be distributed and a list ns of votes per party, we would like to find a number d such that sum(floor(n/d) for n in ns) == N To make things interesting (and more like the real worl...
In this challenge you will be determining how controversial a vote is, given an array of other votes, by figuring out a number called the C-factor. What is the C-factor, you ask? Well, imagine you've got multiple votes on an election. We'll use 1 and 0 for the sake of the challenge to represent two different candidates...
What is the shortest way to convert a string containing integers separated by spaces to a list of integers? input : "-3 1 5 8 10" output : [-3, 1, 5, 8, 10] I regularly face this situation and I wanted to know if there is a better way than (24 bytes): list(map(int,s.split()))
I was surprised to not find this asked already, though there is a great question on darts checkouts: Darts meets Codegolf Your challenge is to calculate which scores are not possible with 'n' darts below the maximum score for 'n' darts. E.g. for n=3, the maximum possible score is 180 so you would return [163,166,169,17...
Introduction A popular word puzzle is to convert one word into another via a series of steps which replace only one letter and which always result in a valid word. For example, BAG can be converted to DOG via a path of five steps: BAG -> BAT -> CAT -> COT -> COG -> DOG Shorter paths also exist in this case; for example...
Premise: Your reputation is in Stack-Exchange Form if it can be represented by decomposing your medal counts (gold, silver, and bronze counted separately) into their base-10 digits and joining them in any given order, with a few caveats. While decomposing, each Gold medal digit is worth three digits. Silver is worth...
I need to construct a functor that iterates over the linear representation of a sub-lattice of size \$d_x,d_y,d_z,d_q\$ embedded in a lattice of size \$n_x,n_y,n_z,n_q\$. The sub-lattice corner is shifted by \$(l_x,l_y,l_z,l_q)\$. Since the functor can be called million of times, the goal is to produce the most effici...
The prospect of this challenge is: If your program is run normally, all of the code in the speech marks (" - double quotes) should be printed. If your program is wrapped in double quotes (in turn inverting the speech marks), the code that is normally not in quotes should be printed. E.g: Let's say you have the follow...
Introduction How much of the English alphabet does a given string use? The previous sentence uses 77%. It has 20 unique letters (howmucftenglisapbdvr), and 20/26 ≃ 0.77. Challenge For an input string, return the percentage of letters of the English alphabet present in the string. The answer can be in percentage or in ...
Assume that there is a number a. In every conversion of that number, the number can either convert itself to its value plus the value of one of its digits, or convert itself to its value minus the value of one of its digits. In this situation, find the minimum number of conversions one has to make in order to get to th...
An analog clock has 2 hands*: Hour and minute. These hands circle the clock's face as time goes by. Each full rotation of the minute hand results in 1/12th of a rotation of the hour hand. 2 full rotations of the hour hand signifies a full day. As these hands are fixed to the same central point, and rotate around that p...
Based on a comment by Jo King on my previous question (called 'Inverse-quotes-quine'), I present this new question. The rules are similar, but just, the opposite: If your program is run normally, all of the code not in the speech marks (" - double quotes) should be printed. If your program is wrapped in double quotes ...
This challenge is a sequel to Letter Boxed Validator. The New York Times has a daily online game called Letter Boxed (the link is behind a paywall; the game is also described here), presented on a square as follows: You are given 4 groups of 3 letters (each group corresponds to one side on the picture); no letter appe...
There are 9 main types of numbers, if you categorise them by the properties of their factors. Many numbers fall into at least one of these categories, but a few don't. The categories are as follows: Prime - no integer divisors other than itself and one Primitive abundant - A number \$n\$ whose factors (excluding \$n\$...
The problem: Given a non-empty set of points in the Cartesian plane, find the smallest circle that encloses them all (Wikipedia link). This problem is trivial if the number of points is three or less (if there's one point, the circle has a radius of zero; if there are two points, the line segment that joins the points ...
The purpose of this challenge is to graphically depict a walk on the plane, where the direction of each step \$k\$ is determined by the primality of \$k\$ and the parity of its binary expansion. Specifically, Initial direction is fixed, say North. All steps have the same length. The direction of step \$k\$ can be Nort...
Write a sorting algorithm for a list of integers that has an average performance of O(n^2). This is code-golf, so the shortest code in bytes wins. RULES: The characters wasted for the declaration of the list are not counted (e.g. var c = new List<int>() { 4, 2, 1, 3 }; is not counted) Builtins to sort a list are not ...
Some numbers, such as \$14241\$, are palindromes in base 10: if you write the digits in reverse order, you get the same number. Some numbers are the sum of 2 palindromes; for example, \$110=88+22\$, or \$2380=939+1441\$. For other numbers, 2 palindromes are not enough; for example, 21 cannot be written as the sum of 2 ...
Given a string x, output the characters in x sorted according to the order of appearance in your source code. Examples Source: ThisIs A Test Input: Is it a Test? Output: TissI etta? Source: Harry - yer a wizard. Input: I'm a what? Output: aa wh'?Imt Source: Mr. H. Potter, The Floor, Hut-on-the-Rock, The Sea In...
According to Wikipedia, a strongly Darboux function is one for which the image of every (non-empty) open interval is the whole real line In other words, a function \$f\$ is strongly Darboux if given 3 arbitrary real numbers \$a\$, \$b\$, and \$y\$, it is always possible to find an \$x\$ between (distinct) \$a\$ and \...
Here is my ungolfed Ruby code for a function I want to try and golf: Iter =-> k { str = "" (0..k).map{|m| str += "-> f#{m} {"} str += "f#{k}.times{f1 = f0[f1]};f1" (2..k).map{|m| str += "[f#{m}]"} eval(str + "}" * (k+1)) } The best I can do to golf this is essentially shortening variable names, rem...
In CSS, colours can be specified by a "hex triplet" - a three byte (six digit) hexadecimal number where each byte represents the red, green, or blue components of the colour. For instance, #FF0000 is completely red, and is equivalent to rgb(255, 0, 0). Colours can also be represented by the shorthand notation which use...
Input A single hex 6-digit colour code, capital letter, without #. Can also be a 24-bit integer if you prefer. Output The closest HTML color name (e.g red, or dark-salmon, as defined as https://www.w3schools.com/colors/colors_names.asp or see below). Distance is defined by summing the difference in red, green and blue ...
Given 2 positive integers in any format you'd like, return their sum using only logic gates and bit shifts (see example below). Don't worry about overflow. EDIT: Using pre-written addition is obviously not allowed. So no a + b, Add(a, b), a - (-b) etc. This is code golf, so standard loopholes apply. Shortest program in...
Introduction: A few days ago I read this post with the same title when I came across it in the HNQ. It asks if this claim of US presidential candidate Bernie Sanders is true or not: Today the world's richest 26 billionaires, 26, now own as much wealth as the poorest 3.8 billion people on the planet, half of the world'...
Introduction So the Challenge is to give out all combinations with two Inputs. The length of the string is also optional and you should be able to edit this. I've selected this channel because I thought it would be very easy to do it "normally" but the challenge itself could be very interesting. I had to create that fo...
Input A single integer in your language's preferred format, e.g int or an array of digits are all acceptable. Output A truthy or falsely value, depending on whether the given number is palindromic (same forwards and backwards) Rules Numbers will always be positive, at least two digits long. This is fastest-algorithm, ...
I'd like to propose a different kind of golfing challenge to this community: (Artificial) Neural Networks are very popular machine learning models that can be designed and trained to approximate any given (usually unknown) function. They're often used to solve highly complex problems that we don't know how to solve alg...
Given two numbers, the first is greater than the second, check whether the first number is divisible by the second without a remainder. If divisible, answer "yes"(or any other string), otherwise "no"(or any other string you like). Conditions: You cannot use conditional operators, loops, arrays, bitwise operations, func...
Backstory Meet my friend Jimmy: /o\ Jimmy is a little character who likes to stand on platforms. Here's Jimmy safely standing on a platform: /o\ ------------- Now, Jimmy has a good sense of balance, so he can safely stand with one leg off of the platform, like so: /o\ ------------------- Although i...
Create your smallest web server in your preferred language! Requirements Must respond to atleast 1 type of request (get,post,patch,delete), with a specified string. Smallest implementation wins! *String can be empty You may use any library you want My personal record for this was 56B in node require('express')().use((r...
This 128-language quine ouroboros (a program which outputs a program in another language, which outputs a program in yet another language, (125 languages later), which outputs the original program) is pretty impressive. But unfortunately, it has a static number of iterations. Write a program which outputs a program (no...
Introduction: Ever used Dropbox with some other people and you both modified the same file? Ever had a multi-user application with a relational database, and two people were modifying (or worse, one was deleting and the other modifying) the same object? Well, let's simulate that with this challenge (sort-of). For the s...
Your challenge is very simple: output the previous answer, in reverse. However, as with this similarly-titled question, there's a catch: in this case, you can only use characters from the answer before the last. For example: Let's say the first answer looks like this: 1 - Python print('hi!') And the second answer loo...
Your challenge is very simple: output the previous answer, in reverse. However, as with this similarly-titled question, there's a catch: in this case, you cannot use characters from the answer before the last. For example: Let's say the first answer looks like this: 1 - Python print('hi!') And the second answer looks...
In this simple but fun challenge, you were asked to determine if Jimmy would fall of their platform. Jimmy has three body parts /, o, and \ arranged like this /o\ Platforms are represented with -. Jimmy will fall off their platform iff they have two or more body parts that are not directly above a platform. Some exa...
I honestly can't believe this challenge does not already exist. The challenge Write a function. The specifics Your program must define some sort of callable function. This includes anything commonly known as a function, a lambda function, or a subroutine. All of these types of callables will be referred to as a "funct...
In a matrix of characters, a cursor is a movable position between two adjacent characters, before the first character or after the last character in a line, like that "I"-shaped indicator which moves while you type. In this challenge, a cursor position is considered valid if at least one of its two sides touches a spac...
This challenge is about Haskell point-free style polynomial functions. Although you don't need to know Haskell language to do this challenge, Haskellers might have an advantage here. Point-free means roughly that variables(points) are not named and the function is created from compositions of others functions. For exam...
Alice is an intern in a company that uses Brainfuck as a primary language for both client-side and server-side development. Alice just has written her first code and she's a bit nervous as she's getting ready for her first code review. Alice wants to make her code properly formatted and look nice, but she has no time t...
Given a date between 2010-01-01 and 2099-12-31 as three integers (please state your order if not [year,month,day]), answer with Tesco's corresponding five-digit Burger Relish Best Before End date number. The format is simply the last two digits of the year, followed immediately by three digits representing the day of ...
It seems as of recent, there have been a lot a Jimmys falling to their death, as can be seen here, and here where you were asked to determine if Jimmy would fall. It is time we put a stop to this madness and try to save Jimmy. Jimmy has three body parts /, o, and \ arranged like this /o\ Platforms are represented with...
This challenge is quite simple to conceptualise, but likely a lot harder to execute. In this challenge, the program will have to detect the number N of its characters that have been randomly changed (at least half of the program will always remain). Then, it will have to output the Nth prime number. A 'change' can only...
Yet another Jimmy challenge by his original father. See these other lovely challenges. As you all know, recently we've been seeing challenges related to Jimmy on platforms. Now, Jimmy is an acrobat as I mentioned before, and he's got other tricks up his sleeve. One of these tricks is hanging by ropes. Here's an exampl...
This challenge will have you count pseudo-polyforms on the snub square tiling. I think that this sequence does not yet exist on the OEIS, so this challenge exists to compute as many terms as possible for this sequence. Update: this is now on the OEIS as A309159: Number of generalized polyforms on the snub square tiling...
Write a function to produce, for a non-negative integer, a string containing a sum of terms according to the following: 3 -> "3" 805 -> "800 + 5" 700390 -> "700000 + 300 + 90" 0 -> "0" 13 -> "10 + 3" 200 -> "200" Any input other than a non-negative integer can be ignored. Zero terms must be skipped unless the inp...
Challenge Description: Write a program that asks the user for input. The user will enter Good or Bad. You do not have to support any other input. If the user enters Good, print Bad and vice versa (to stdout etc). Notes: 1) You cannot use any other pair of two words. 2) Your program only has to ask and print once. 3) Yo...
In 256 bytes or fewer write a function, \$f\$, from the positive integers to the positive integers that is: Monotonic: larger inputs always map to larger outputs. (\$a < b \implies f(a) < f(b)\$) Non-linear: does not have asymptotic order notation \$O(n)\$. (\$\displaystyle\forall c: \exists n:c\cdot n < f(n)\$) Your...
Problem: We have a two dimensional matrix of positive integer cells. On each turn any non-zero cell with a neighbor (top/bottom/left/right) of zero decreases by 1. We want count to the number of non-zero cells present and add them up across all turns. Is there a faster solution than to use a priority queue? Is there a...
The rule is: a, b, c, d, e is an integer from 0 to 1000, no relation between a, b, c, d, e so a can equal to b or c, ... can not use more than 3 loops (it can be 3 nested loops or 3 normal loops, or 2 nested loops + 1 normal loop, ...) you need to find all the answers for (a, b, c, d, e) that is: a + b + c + d + e = ...
Introduction: I think we've all heard of it, but here a very brief summary: Noah gathered two of every species of animal on the planet, male and female, to save in his Ark during a great flood. The actual quote from the Bible is: Genesis 7:2-3 You must take with you seven of every kind of clean animal, the male and it...
Challenge Create a console program to display each byte of a file. Winning Since this is code-golf, fewest bytes wins. Rules Program must be a console application, meaning that it will be ran from some sort of command-line interpreter; Every byte must be uppercase hexadecimal, separated by a space, and it must be 2 ...
Simple problem, create a programme that takes one input, and the outputs that input in reverse. Some test cases are [input -> output]: Hello World! -> !dlroW olleH Code Golf -> floG edoC Reverse Cat Programme -> emmarporG taC esreveR Shortest answer wins Note: It doesn’t have to support multi-line inputs and it doe...
Given two numbers in tape location #0 and tape location #1 in Brainfuck, compute their product into another tape location (specify with answer). Optimize for the least amount of time-units used, where the interpretation of any command uses one time-unit. As example, here is a quick C++ program to determine the number o...
The challenge is simple: Print the last, middle, and first character of your program's source code, in that order. The middle character is defined as follows, assuming a source length of n characters, and 1-indexing: If n is even, print the n/2-th and n/2 + 1-th character. (abcdef == cd) If n is odd, print (n-1)/2 + 1...
(a paradox, a paradox, a most ingenious paradox) This is the first part of a multipart series inspired by different R functions. The Task Given a dataset \$D\$ of positive integers, I need you to compute the 5 number summary of \$D\$. However, I'm working on large datasets, so I need your code to be as small as possibl...
Task Given an input string of one or more ASCII characters which codepoints are between 0 and 128 (exclusive), do the following: Convert each character into its 7-bit ASCII code (if the ASCII code is less than 7 bits, put leading zero bits) Concatenate all bits (this results in 7*n bits where n is the number of charac...
Given a start word and a target word, print the "mutation chain" that starts at the start word and ends at the target word. You may assume both words are lowercase and only have alphabetic characters. Define a "mutation" as the removal of an character, the insertion of a character, or the altering of a character. For e...
Concept In what ways can you scramble the English alphabet so that it can still be sung to the tune Twinkle Twinkle Little Star without ruining the tune? Rules Swapping Let's just assume the letters contained in each of the following sets can be swapped freely by default without ruining the tune: { A, J, K } { B, C, ...