instruction
stringlengths
34
53.1k
Output coordinates of the vertices of a cube. Then, output a list of twelve triangles that will cover the cube, each triangle being a list of three vertex-indexes, consistently oriented. Output must be an ASCII string of distinct decimal numbers. This golf has no input. Winner is the fewest characters, where the charac...
Because of this, you need a better way of working out if a phrase is an acronym of a word. You also think it would be worthwhile to see if the phrase and word in question are recursive acronyms. Your task: Given a word and then a phrase separated by a line, output if the phrase is an acronym and then if it is a recursi...
User quartata posted this challenge, but he neglected the fact that, for whatever reason, he's not able to play MIDI files on his computer. Let's help him out by writing a full program that reads a song in RTTTL format from the standard input, prints the song name to the standard output and plays it (at the right speed...
The Challenge The game Light Up! is a simple puzzle game where the objective is to light up every cell in an n-by-n array with light bulbs. However, there are blocks in the way that will prevent light from traveling, and no lightbulb can be places such that another lightbulb shines light on it. Each light bulb has ligh...
Given (by any means) two different natural numbers (of any reasonable size), output (by any means) the square of their sum as in the examples below: Given 4 and 3, output: 12 12 12 12 9 9 9 12 12 12 12 9 9 9 12 12 12 12 9 9 9 16 16 16 16 12 12 12 16 16 16 16 12 12 12 16 16 16 16 12 12 12 16 16 16 16 12 12 12 ...
The Challenge I always write my math assignments down in the same way. For example: pg. 420: #25, 50-56, 90 pg. 26: #50-60 evens, 70-80 odds, 90-99 3s pg. 69: #12, 16, 18, 37 But I need you to tell me the individual problem numbers. For example: input: pg. 420: #25, 50-56, 90 output: 25, 50, 51, 52, 53, 54, 55, 56, ...
The challenge Insert one string into another at a given index. Given a string input in the format: #:Pattern:Word Where: # is a positive integer marking the index Pattern is the string (whose length is undefined) to insert : is a delimiter Word is the string to insert into. Assume that a : will not be used in either...
Monday Mini-Golf: A series of short code-golf questions, posted (hopefully!) every Monday. Sometimes folks get tired of life's rules: "don't do this", "you can't do that", "we won't let you do this". It can seem really restricting at times! But every now and then, it's good to have a little fun, so let's write some cod...
Task Your task is to write whole program, which will align given input to a block of given size. Input: 40 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea ...
Create a routine to calculate the position of each unit of a clock with an arbitrary number of units (minutes, hours, half-days, days, years, parsecs, quarter-quells, etc), where each unit can be equally sub-divided into an arbitrary number of sub-units; after n base units have elapsed. Basically, figure out what a cl...
The partial sums of a list of integers [a1, a2, a3, ..., an] are s1 = a1 s2 = a1 + a2 s3 = a1 + a2 + a3 ... sn = a1 + a2 + ... + an We can then take the list of partial sums [s1, s2, s3, ..., sn] and compute its partial sums again to produce a new list, and so on. Related: Iterated forward differences Input: A non-em...
In this task, your goal is to write a program for generating hexdumps of files of arbitrary types. Input The input consists of a (relative or absolute) path to the file to be processed. It may be taken from STDIN, a function argument, or a command line argument. Output The output (which may be written to a separate pla...
There is a variant of the well-known N-queens problem which involves queens and knights and is said to be "considerably more difficult" 1. The problem statement is as follows: You must place an equal number of knights ♞ and queens ♛ on a chessboard such that no piece attacks any other piece. What is the maximum numb...
Computers are everywhere nowadays - in cars, trains, skateboards, even nuclear reactors. The possibility that your software will run in a time travelling device is just a matter of time. Can you deal with it? Can you at least detect it? Your task: Write a program that loops and keeps querying the system time, in order...
Introduction There comes a point in childhood when you think you've mastered adding and multiplying, then someone comes along and informs you that: a * b + c = (a * b) + c != a * (b + c), and that it wasn't as simple or linear a process as you were earlier taught. You learn that there exists something called the order ...
Energy levels of electrons Electrons are ordered into "shells". However, sometimes electrons get excited, for example by heat, and leave their shell to go to another! These electrons will go back at some point, but they cannot go back to their original shell without emitting energy in the form of radio waves. For examp...
Hopefully not duplicate, but I did not find one. Challenge The challenge is to write full program, which compiles (without errors), but, when executed, will not finish the execution till the end, because an error appears during the execution. Rules It has to be full program, which is compile-able or interpret-able in ...
The city of Poughkeepsie celebrates Halloween every year. Geographically, the city is a rectangle that is 30 miles long and 45 miles wide. On a map, it looks like a grid, with its east-west roads horizontally dividing the city into 1-mile-long rectangles and its north-south roads vertically dividing the city likewise. ...
Task Find the set of numbers such that the binary representation contains two or more runs of 1 separated by at least one 0. For example, the for the numbers that are 4 bits long: 0 0000 (no ones) 1 0001 (only one run) 2 0010 (only one run) 3 0011 (only one run) 4 0100 (only one ...
A sturdy square (akin to a magic square) is an arrangement of the integers 1 to \$N^2\$ on an \$N\$ by \$N\$ grid such that every 2 by 2 subgrid has the same sum. For example, for \$N = 3\$ one sturdy square is 1 5 3 9 8 7 4 2 6 because the four 2 by 2 subgrids 1 5 9 8 5 3 8 7 9 8 4 2 8 7 2 6 all sum to the same amoun...
The order of operations, PEMDAS, is a basic rule in mathematics telling us which order operations should be performed: "Parentheses, Exponents, Multiplication and Division, and Addition and Subtraction" The problem is, PEMDAS is not very versatile! What if you wanted to do it in another order? We won't mess with the pa...
To conjugate a verb in l'imparfait, one needs to perform the following steps: Find the "stem" of the word; this is achieved by omitting the -ons from the nous-conjugated form of the word. For example, vivre is nous vivons; removing -ons from vivons yields viv-. Take the stem and add an appropriate ending, according to...
Introduction In this challenge, your task is to implement a collection of simple functions that together form a usable mini-library for simple probability distributions. To accommodate some of the more esoteric languages people like to use here, the following implementations are acceptable: A code snippet defining a c...
This challenge is to lift the spirits of our mod Alex A., who is usually wrong. Suppose you have a friend named Alex who needs help with basic logic and math, specifically mathematical equivalence. He gives you a list of equations of the form [variable] = [variable] where a [variable] is always a single uppercase lett...
Craps is a fairly simple dice game often played in casinos. Even if you aren't a gambler (which I'm not), it's still a fairly interesting game. Here's the rules: At the start of a game of Craps there's what is called the come-out round. The player rolls two d6s (six-sided die) and the two die rolls are added. If the re...
OCTOBER 22 IS INTERNATIONAL CAPS LOCK DAY! UNFORTUNATELY, SOME DO NOT RECOGNIZE THE GLORY OF THE ALMIGHTY CAPS LOCK. THEY SAY IT SEEMS "OBNOXIOUS" OR "LIKE SHOUTING" OR SOME NONSENSE. IN ORDER TO CONFORM TO THESE OBVIOUSLY ILLOGICAL AND INANE COMPLAINTS, PLEASE WRITE ME A PROGRAM THAT TURNS NORMAL TEXT INTO "SENSIBLE" ...
Background The task is simple but every programmer has implemented it at least once. Stackoverflow has a lot of samples, but are they short enough to win? Problem story You're a grumpy programmer who was given the task of implementing file size input for the users. Since users don't use bytes everyone will just enter "...
Challenge Forsyth–Edwards Notation (FEN) is a standard notation for describing a particular board position of a chess game. Your challenge is to evaluate the score using the FEN string. This is an example of a FEN string: 5k2/ppp5/4P3/3R3p/6P1/1K2Nr2/PP3P2/8 Using this string, you can calculate the material score for ...
The Challenge Mission You are Jim, a CIA agent in charge of super secret spies around the world. However, your enemies, the Naissurs, are highly trained in computer intelligence, and they can hack into your super secret communication systems. To contact your super secret spies, you must encrypt each message with a 16-c...
Cell Phone Keyboard Typing This question was asked a while back, but was closed due to poor specs. So, I'm redoing it, with better specs. This question is related, but goes in the opposite direction. Before T9 came around, in order to type a character in a text message, you had to press one of the number keys a number ...
I absolutely hate the digit 1. So, I need your help to convert numbers to their "proper forms". Numbers in proper form never have two 1s in a row. 101 is okay, but 110 is hideous. To convert, simply skip all the improper numbers and count normally. For instance... 1 -> 1 2 -> 2 ... 10 -> 10 11 -> 12 12 -> 13 ... 108 ->...
Write a program or function that outputs/returns the first 10000 prime-indexed prime numbers. If we call the nth prime p(n), this list is 3, 5, 11, 17, 31, 41, 59 ... 1366661 because p(p(1)) = p(2) = 3 p(p(2)) = p(3) = 5 p(p(3)) = p(5) = 11 p(p(4)) = p(7) = 17 ... p(p(10000)) = p(104729) = 1366661 Standard loopholes...
In the future when Time Travel (abbreviated as TT) will be common, coin tossing will become a serious mind-sport. To prepare for the future we create a competition for programs where time traveling will be really happening from the viewpoints of the entries. The competition is a round-robin style King of the Hill consi...
Your geologist buddy nearly kicked down your office door as he burst in, eyes wide in excitement, and asked you to come with him to a site he just discovered. On the way he explains that he thinks he literally just struck gold. Only problem is, it's buried deep underground in a cavern with a very unstable roof. It's to...
Objective Given a grid of numbers, fill in the inequalities. Assumptions The number of columns and rows in the grid are equal. The maximum size of the grid is 12x12. The grid only consists of integers 0-9. The output may contain a trailing newline. The input is exactly as written below, including spaces and newlines. E...
Given an input string only containing the characters A-Z, a-z, and spaces, remove all occurrences of the uppercase and lowercase versions of the first character of the string (if the first character is A remove all As and as, if the first character is (space) remove all spaces), and print the output. Example cases: T...
Write a program in any language that reads input from stdin and outputs a slightly modified output to stdout. The program should borrow some characters from the input and output as large of a prefix as possible of *language-name* is awesome! followed by a newline and then what's left of the input. The input does not ...
I don't like numbers, but I do like the Fibonacci sequence. I'm sure we could work something out. Please read one integer n from STDIN and output the nth Fibonacci number in base 26 (abcdefghijklmnopqrstuvwxyz instead of 0123456789) to STDOUT. The first Fibonacci number is 0. The second one is 1. The nth fibonacci num...
Write a program or function that takes in a nonempty list of mathematical inequalities that use the less than operator (<). Each line in the list will have the form [variable] < [variable] where a [variable] may be any nonempty string of lowercase a-z characters. As in normal math and programming, variables with the s...
The cumulative sum of a vector is calculated by simply taking the sum of all previous elements. For instance: vec = [1 1 1 -1 -1 -1 -1 -1 1 1 1 1 -1] cum_vec = [1 2 3 2 1 0 -1 -2 -1 0 1 2 1] Now, impose an upper and a lower limit, meaning that you stop increasing the cumulative sum if it's at the up...
Substitute a string with itself Your goal is to substitute a string with itself by replacing each character in the original string with the one before it, starting with the first character and wrapping around. Here are some examples to show what I mean: 1st example: Input: program Output: apgopra How: Program -> mrogr...
For this challenge, we are writing the time in the following form: hh:mm:ss Some examples: 12:34:08 06:05:30 23:59:00 The challenge is to output the time after an amount of hours, minutes and seconds have elapsed, with as starting time 00:00:00. You can compare this with a timer that started at 00:00:00. Here is an e...
Introduction Help! I accidentally dropped my TI-84 calculator out my window (don't ask how) and it broke. I have a math test tomorrow and the only calculator I can find is one with these buttons: 7 8 9 + 4 5 6 - 1 2 3 * 0 = / My math test is a review test on evaluating expressions. I need a program to take an expres...
Back to the basics! You're in you comp sci class again, except wiser and golfier. You have the tools, you have the power… but do you have the skill? Probably. Crash Course for the non-Computer Scientist (skip if you don't need it) A string is symbolically represented by an arbitrary letter (usually, for our purposes, w...
Let's parse some regex. Not quite the regex you are used to, but the formal regular expressions taught in courses on automata theory. Wikipedia knows what I'm talking about. We have four operations. In order of priority, from highest to lowest: Parenthesis. (a) The contents of the parenthesis is a regular expression ...
Given two points A and B, find the angle from line AO to line BO about point O where O is the origin ((0,0)). Additionally, the angle may be positive or negative depending on the positions of the points (see examples). Input will be points A and B, and may be given in any convenient form. Output will be the angle in de...
Robbers' challenge thread is here. Cops' challenge: Design a programming language that appears to be unusable for programming, but admits computation (or at least completion of the task) through some non-obvious mechanism. You should design a simple programming language that reads code from an input file and then does ...
See the cop thread for more information. Each answer to this question should crack an answer there. That is to say, it should be code to find the third-largest integer in the input when run in the interpreter given in that answer. If you post a crack that turns out to be invalid, you should delete it and are ineligible...
Dropsort, designed by David Morgan-Mar, is an example of a linear-time "sorting algorithm" that produces a list that is, in fact, sorted, but contains only some of the original elements. Any element that is not at least as large as the maximum of the elements preceding it is simply removed from the list and discarded. ...
My fifth-grade daughter is learning about codes and ciphers. She has reached the point of decoding a ciphertext that has been encoded with the Caesar cipher where the offset is not provided in advance. Without computers this can be time-consuming, especially for long blocks of text. Luckily, we do have computers, and l...
Backstory: You enjoy your new programming job at a mega-multi-corporation. However, you aren't allowed to browse the web since your computer only has a CLI. They also run sweeps of all employees' hard drives, so you can't simply download a large CLI web browser. You decide to make a simple textual browser that is as s...
Challenge Winter is fast approaching with many places receiving the first layers of snow for the 15/16 season, so why don't we break out the snow machines and code ourselves some snow? Given a integer n via STDIN, output an ASCII representation Beta's snowflake (as described below) at level n. Beta's Snowflake The snow...
The obstacle course You are currently stuck in some kind of course and you have to escape. However, if you do not choose the fastest way then the exit will close in front of you. Your challenge is to find the fastest route in an obstacle course. Input Your input consists of a list with lists in it, a 2D grid containing...
Monday Mini-Golf: A series of short code-golf challenges, posted (hopefully!) every Monday. True story1: The other day, I was playing around on my tablet when I had the idea to visit the page I normally use on my PC for testing JavaScript. After the page loaded, I entered this simple program: alert("Hello!") I then pr...
Some time after this incident… There are some of us who are against this defiling order of jQuery. It is an unholy presence, of which must be exterminated. I therefore call on you, the loyal to The New Kingdom of Reformation, to create a program that will eliminate such resistance. All code must be validated and search...
Or else he will huff and puff and blow your house down! That was completely irrelevant. This challenge is actually about Huffman coding. The gist of it is the frequency of characters in a given text is utilized to make its representation shorter. In other words, let's say that our alphabet is a through z and space. Tha...
Question If you are currently on a cell with a value x, you can move to any cell in the same row or column, provided it has a value y such that x > y. This move is called a switch. The input consists of: two integers 0 < m,n < 50 an integer k indicating the number of switches allowed 0 < k < 20 an m by n grid ...
The video game Transistor features a very interesting ability system. You collect 16 "Functions" which you can use in 16 different slots. What's interesting is that there are 3 types of slots and every Function behaves differently according to which slot you use it in: There are 4 Passive Slots. There are 4 Active Slo...
Write a program that takes as its input a string that outputs a string with the following properties. If a character in the string is an uppercase letter (ASCII 41-5A), then the character is replaced by a string containing every letter up to and including the original letter in upper case. For example, if the input st...
Introduction The challenge is a very interesting variant of the game racetrack and those two challenges: To Vectory! – The Vector Racing Grand Prix Program a Racing Car Source of this challenge is here (in German): c't-Racetrack This challenge is especially interesting (and different from the two abovementioned chall...
Given a positive integer below 1000, display all possible rectangles with that area. Task Let's say the input is 20. We can make a rectangle 20×1, 10×2, or 5×4, so this is a valid output: ******************** ********** ********** ***** ***** ***** ***** Note that each possible rectangle appears exactly once. The re...
Create a program that find the latest 50 challenges with the code-golf-tag that have at least 20 answers. Then, extract the scores for each language in each of the challenges. If there are more than one answer using the same language, count all scores. Thereafter, take the top 20 most common languages and output a list...
This challenge is inspired by this Oliver Sacks quote: “At 11, I could say ‘I am sodium’ (Element 11), and now at 79, I am gold.” ― Oliver Sacks I want you you find numbers in a string and replace them with their corresponding elements' symbols. (1 is H, 2 is He, 3 is Li, etc.) There are a few rules to follow: Sin...
Write a program or function that takes in a positive integer N and recreates this pattern of circles scaled to fit an N×N pixel image: This image is a valid output example for N = 946. In case it's not clear, all the small light-blue circles have the same radius and are positioned in the four dark-blue circles in the ...
Introduction You are a biologist studying the movement patterns of bacteria. Your research team has a bunch of them in a petri dish, and you are recording their activity. Unfortunately, you are seriously underfunded, and can't afford a video camera, so you just take a picture of the dish at regular intervals. Your task...
Related Exposition After winning the SO raffle, you could have been on top the world, and you were! The raffle had been going on for a year, now, and you were one of a hundred programmers who were selected to enter into the SO stronghold. And finally, the wait is over. Today is the day you go to--[obfuscated text proce...
Challenge Given an element name, output its electron configuration. Input Your input will be the full name of each element (the range being from Hydrogen, 1, to Calcium, 20) with some exceptions - you should be able to account for the following inputs: Natrium - This is sodium Kalium - This is potassium Note that inpu...
Remove all repeating words from an inputted sentence. Input will be something like cat dog cat dog bird dog Snake snake Snake and the output should be cat dog bird Snake snake. There will always be a single space separating words. Output order must be the same as input. (Refer to the example) You don't need to handle p...
Note: as this question has been marked as a duplicate, I have accepted an answer. However, I will still check this question if users can find a shorter way of doing it, and accept that answer. Given two numbers (which are multiples of 0.5) representing heads-percentage and tails-percentage from a series of coin-flippin...
This is a graphical output challenge where the task is to give the shortest code per language. Task Your code should plot a single purple pixel (hex value #800080 or rgb(128, 0, 128)), moving clockwise round a circle. It should take exactly 60 seconds to make a full journey round the circle and should continue indef...
The scene is: Peter is at the gym with his buddy Brian when Brian suddenly is in dire need of his inhaler. Brian manages to tell Peter the code to his combination lock before he collapses on the floor. The moment Peter gets to Brian's locker and sees what the indicator is pointing at, Stewie ambushes him and sprays a f...
Long-time lurker, first-time poster. So here goes. In the Wikipedia page for quine, it says that "a quine is considered to be 'cheating' if it looks at its own source code." Your task is to make one of these "cheating quines" that reads its own source code. This is code-golf, so the shortest code in bytes - in each lan...
Note: this challenge involves downloading and sifting through HTML webpages. If your language cannot handle this you might not want to participate in this challenge. Introduction There are always discussions over in The Nineteenth Byte Chat about who leads the starboard. So, lets help everyone out and count the total a...
First challenge! What is an ambigram? Ambigrams are word(s) that read the same word(s) or another word given a certain transformation and possibly stylistic alterations. Example: That's an example of a rotational ambigram; it reads the same word, even when flipped around. The Challenge You are to create a function, pr...
Damn, that's a lot of carrots. The Inspiration The Task You must create a program, that, in as many languages as possible, replaces every instance of ^ with a markdown formatted link (meaning that if I was to post it in an answer, it would automatically read it as an image and place the image instead of the words) ...
This is inspired by Monday Mini-Golf #6: Meeesesessess upp teeexexextext Background ETHproductions have difficulty entering text on his usual webpage. Whenever he use digits or letters, the text will be meeesesessessesseesseessedessed up. Your task is to help him type so the normal behavior is achieved. The transform T...
Write a complete program that takes a boolean or non-negative integer input. It must: Output its own source code if the input value is falsy Output its own source code in reverse if the input value is truthy Your program cannot be palindromic, nor can it read its own source code by any means. This is code golf - shor...
One of the most common standard tasks (especially when showcasing esoteric programming languages) is to implement a "cat program": read all of STDIN and print it to STDOUT. While this is named after the Unix shell utility cat it is of course much less powerful than the real thing, which is normally used to print (and c...
Task The user inputs a sentence - words only. Any input other than letters or spaces, including integers and punctuation, should throw an exception: "Sentence must only use letters". The output has a pattern, where some words are reversed and others words are normal. The pattern starts as a normal word, the next two ...
Write a program that takes an input string of length 2 or more characters and adds the string ~BOO!~ (that string has a leading and ending space) in a uniformly random spot in the string that is not on either end. Disallowed sample inputs: 2 or (an empty input) Disallowed sample outputs: Hello ~BOO!~ or ~BOO!~ H...
A current internet meme is to type 2spooky4me, with a second person typing 3spooky5me, following the (n)spooky(n+2)me pattern. Your mission is to implement this pattern in your chosen language. You should write a program or function that takes a value n (from standard input, as a function argument, or closest alternati...
Question You have a 50 by 50 character array. Each cell has an arrow pointing in any one of four directions. No cell is empty. On entering a cell, you must exit it in the direction specified by the arrow. The arrow may also point in the same direction you came from, resulting in a dead end. You may start from any cell ...
Intoroduction If you've ever been to Epcot at Disney World, you've probably been to the world showcase: a lake surrounded by various country-themed locations. One thing that's always bothered me about it is that the countries don't appear in the order you would run into them around the world. There are officially eleve...
Proto space invaders This is a graphical output challenge where the task is to give the shortest code per language. Task Your code should allow the user to move the following alien around the screen/window. Your code can simply load it from a local file. Feel free to convert it to another standard image format or e...
Your challenge is to write 5 different full programs for the 5 following tasks: Print Hello, World!. Given an input on STDIN, output the factorial (you can assume that the input is an integer ≥ 0). Given an integer N, calculate the sum of the primes ≤ N. Given an input on STDIN, output the letters used in the input. F...
Well... there are 59 (now 60) questions tagged sorting, but no simple quicksorts. That must be fixed. For those unfamiliar with quicksort, here is a breakdown, courtesy of Wikipedia- Pick an element, called a pivot, from the array. Reorder the array so that all elements with values less than the pivot come before the...
Write a program that generates a sequence of numbers starting with zero and then 100 random integers between -9 and 9. That sequence will be displayed like a roller coaster. Any increasing number in the sequence will go up and any decreasing number will go down Sample sequence: 0 1 8 5 -1 -5 7 1 3 3 4 6 9 -2 ... Sampl...
Given the number of vertices N of a convex polygon and each of their (x, y) calculate the polygon's area. vertexes are in clockwise order You must handle all N <= 45 ,-600 <= x,y <= 600, and your answer must be accurate to at least 2 decimal places. Example: 3 1 6 1 2 -4 2 The area is 10.00. This is code-golf, fewe...
cat goes "Meow" We are all familiar with the concept of a cat program. The user types something in, it is echoed back to the user. Easy. But all cat programs I've seen so far have missed one fact: a cat goes "Meow". So your task is to write a program that copies all STDIN to STDOUT UNLESS the input is cat, in which ca...
Design a random number generator where the i th number has i% chance of occurring for all 0 < i < 14. 0 should have exactly 9% chance of occurring. The seed for the generator should be the system time. You cannot use a pre-defined function for random number generation. Basically 1 has 1% chance of occurring, 2 ...
Is this Q too easy to ask, or has it just never been thought of? Generate a random number, either 0 or 1 using a program You may use a pre-defined function. The code must be executable. (It can't be just a function that requires more code to execute.) Randomness of the output will be verified by showing that it is no...
Given two lists of numbers, a source and a pattern, reorder the source to match the relative ordering of the pattern. Any two entries of the reordered source should compare the same way as the entries at those same positions of the pattern. For example, the input s = [-5, 9, 4, 13, 11, -6, 0] p = [7, -4, 1, -8, 4, -3, ...
There is a game I like to play. It happens on a grid of finite size (but it's wrapped, like a sphere). On that grid, a random (integer-only) point is selected. Then, I, the user, am prompted for a coordinate input. If my input matches the random point exactly, I am told that I have won. Otherwise, I am told the point-w...
Print or return these lyrics: Dea Mortis, iuravi Carissimam servaturum. Dea Mortis, servabo Ut tempora recte ducam. Etsi cor in Chaos, Aut Fortuna bella ferat, Occurram et obviam ibo. The line break must be preserved, and trailing newlines are allowed. +20% if you omit the end-of-line punctuation, +30% if you omit al...
Introduction Given an ASCII tower and the force of the wind, write a program or function to determine if the tower will balance or which way it will fall. For example the first tower balances but the second falls over toward the left. # # # # ### ### ### ### # # # # ...
Your task is to create a program that will, given an input image, create an output image of the same size, where all pixels are ordered by hex value. Your program may: Sort the pixels from left to right and then down or first sort down in columns and then right. In any case, the top left pixel is the smallest, and the...
Valve's KV file format is as follows (in pseudo-EBNF): <pair> ::= <text> <value> <value> ::= <text> | <block> <text> ::= "\"" <char>* "\"" <block> ::= "{" <pair>* "}" The parsing starts on <pair> state. Whitespace is allowed anywhere, but is only required between two consecutive <text> tokens ("a""b" is invalid, but "...
Your task is make program that do following: You should take number. (Positive, negative, fraction is possible input) If it is negative, you reverse the quine. and negate that number (Become positive) Then you repeat <integer part of the input number> times and print first <floor(fraction part of the input number*leng...
Input A list of between 1 and 255 positive integers (inclusive), each in the range 1 to 232 - 1 (inclusive). Your input format does not need to be identical to the test cases. Input without leading zeroes is required to be accepted. Input with leading zeroes is not required to be accepted. You may use whatever delimit...
Write a program that takes two integers as an input; the first can be any integer and the second is less than or equal to the number of digits in the first number. Let these numbers be a and b respectively. The program will do the following Concatenate a minimal number of 1s to the end of a so the number of digits in ...