instruction
stringlengths
34
53.1k
You need to produce output that is non-deterministic. In this case, this will be defined to mean that the output will not always be the same result. Rules: A pseudo-random number generator that always has the same seed does not count. You can rely on the program being run at a different (unknown) time each execution. ...
Write a program or function which, given a non-empty sequence of right or left turns, outputs the length of the shortest self-avoiding path on a 2D lattice with those turns. The input should be taken as a string, with each character being R or L for a right or left turn respectively. The output should be an integer, th...
All Aboard the ASCII Train! o O O ___ ___ ___ ___ ___ ___ ___ ___ ___ o | C | | O | | D | | E | | | | G | | O | | L | | F | TS__[O] |___| |___| |___| |___| |___| |___| |___| |___| |___| {======|_|"""""|_|"""""|_|"""""|_|"""""|_|"""...
There’s a famous tricky algorithm for counting the number of set bits in a 32-bit unsigned integer: int popcount(unsigned x) { x = (x & 0x55555555) + ((x >> 1) & 0x55555555); x = (x & 0x33333333) + ((x >> 2) & 0x33333333); x = (x & 0x0F0F0F0F) + ((x >> 4) & 0x0F0F0F0F); x = (x & 0x00FF00FF) + ((x >> 8) & 0x...
Write a program which runs forever and allocates more and more memory on the heap the longer it runs, at least until you reach the limit of the operating system on the amount of memory that can be allocated. Many kernels won't actually reserve memory you allocate until you use it for something, so if your program is in...
My homework is to write a Martian essay (see below) between 729 and 810 words, inclusive. Your task is to write a program that will generate the essay. History Around the turn of the 20th century, spiritualist Catherine-Elise Müller allegedly communicated with Martians. During somnambulatory trances, she would write ...
Introduction Suppose we have a network of railroads. Each junction in the network is controlled by a switch, which determines whether an incoming train turns left or right. The switches are configured so that each time a train passes, the switch changes direction: if it was pointing left, it now points right, and vice ...
Write a Java method to check if a given string matches any value in a given enum. Your method will take two parameters, one a string and one an enum, and return true if the string representation of any of the enum's elements matches the given string, or false otherwise. Note that your method should still function norma...
Draw lines between every pair of distinct points for n points arranged in a circle, producing something like the below result. Shortest code (in bytes) wins! Your lines don't have to be transparent, but it looks better that way. The output must be a vector graphic, or be an image at least 600 pixels by 600 pixels (eith...
Alphabetize Integers For a given set of numbers, put them in alphabetical order when they are spelled out (i.e. 1: one, 2: two, 90: ninety, 19: nineteen). Your code should work for the range [-999999, 999999]. Output must have a delimiter between numbers. A space will work, as will a space and a comma as shown in the e...
I like the Hilbert Curve. Your task for this challenge is to take an image (strictly a square image where all the sides are a power of two pixels wide) and unravel it line by line in a zig-zagging fashion and ravel it back up in a pseudo-Hilbert curve. Unraveling To unravel you will start with the pixel in the upper l...
Long time lurker first time poster here. Write a program which takes 3 inputs: X, Y and Z. X = across (columns) Y = down (rows) Z = Location Marker The program should then print a visual grid X across and Y down. This grid will can be made of any character except "+". Each 'location' is given an index number, count...
Introduction A radix tree, also known as compressed trie or compressed prefix tree, is a tree-like data structure for storing a set of strings. The edges of the tree are labeled by nonempty strings, and each node is either terminal or nonterminal. The strings that the tree contains are exactly the labels of all paths f...
Write the shortest program which, when run with no arguments, stdin, or user input, triggers a core dump. Your code must behave this way when run on some common out-of-the-box Linux distribution. Other than installing support for your target language, you may not reconfigure the system to make it more fragile than it i...
Welcome to the grinder. Your task is to make big rocks into small rocks by grinding them. Take an input of a big rock of size n > 3 and grind it. Continue to grind the rocks by dumping them into the grinder until the size of all the rocks are 2. rocks are always grinded into equal even halves. If the result of a grin...
Given a string representing a series of aircraft marshalling hand signals, write a function or program to calculate the final position of an aircraft following these signals. N.B.: Co-ordinates in this challenge are represented as a pair of Cartesian co-ordinates, plus a compass direction heading: (x, y, h) where x is ...
Each term in the squaring sequence, \$x_n\$, is created by taking \$x_{n-1}\$, squaring it, and removing all but the first four digits. The sequence always begins with \$x_1 = 1111\$. Squaring this yields \$1234321\$, so \$x_2 = 1234\$ The first few terms are: 1111 1234 1522 2316 5363 ... The Challenge Your task is t...
The Definition Given an integer x, a version series is a set of digits (base 10) from which any x-length subset of consecutive members is unique compared to all other possible subsets of the same length (a unique "version"). The Task Write a function which, when passed some subset length x, produces a version series, c...
In the IRC protocol, raw messages look similar to this: command arg1 arg2 :arg3 with spaces :arg4 with spaces :arg5 In a shell environment (e.g. bash), that would be equivalent to: command arg1 arg2 "arg3 with spaces" "arg4 with spaces" arg5 The format specification is as follows: Raw messages will only contain prin...
I though this would be a good challenge : http://adventofcode.com/2016/day/1 Task description Given a sequence of rotations and distances following the pattern (L|R)[1-9][0-9]*, give the manhattan distance between the start and the ending points, that is the minimal number of vertical and horizontal moves on a grid. Ex...
For more information, watch this video, and go to A276523 for a related sequence. The Mondrian Puzzle (for an integer n) is the following: Fit non-congruent rectangles into a n*n square grid. What is the smallest difference possible between the largest and the smallest rectangle? For 6, the optimal difference for M(6) ...
Write a regex that works in at least 2 regex flavors (or versions), and match a different string in each flavor (or version) it is running in. The strings to be matched in this challenge are the first words of the Ubuntu code names, which are listed below. Your regex has to match from the top of the list. That is, if y...
Minesweeper is a popular puzzle game where you must discover which tiles are "mines" without clicking on those tiles. Instead, you click on nearby tiles to reveal the number of adjacent mines. One downside about the game is that it is possible to end up in a scenario where there are multiple valid answers and you may o...
My teacher was more than unhappy with my Martian Homework. I followed all the rules, but she says that what I output was gibberish... when she first looked at it, she was highly suspicious. "All languages should follow Zipf's law blah blah blah"... I didn't even know what Zipf's law was! It turns out Zipf's law states ...
This is a cops and robbers challenge - Robber's Thread Write a program that terminates after exactly 60 seconds (or as close to it as possible). For example: #include <unistd.h> int main(int argc, char **argv){ sleep(60); return 0; } However, your goal is to write this program such that terminating after exact...
Let's create a simple, surjective mapping from positive integers to Gaussian integers, which are complex numbers where the real and imaginary parts are integers. Given a positive integer, for example 4538, express it in binary with no leading 0's: 4538 base 10 = 1000110111010 base 2 Remove any trailing 0's: 1000110111...
This is a cops and robbers challenge - Cop's Thread Each of the cops have been tasked to write a program that terminates after exactly 60 seconds, or as close as possible. For example: #include <unistd.h> int main(int argc, char **argv){ sleep(60); return 0; } Your goal is to take any of the uncracked submissi...
My wires are all tangled! Isn't it annoying when wires get all tangled up? Well, that just happened to me, so I'd like to to help me untangle them! For your convenience, I've disconnected them all from the device, but they're all still connected to the outlet. Your challenge is to figure out how to untangle them! Input...
Given an integer from 1 to 999 inclusive, output a truthy value if it appears horizontally, vertically, or diagonally, either forwards or backwards, anywhere in the 3x3 square of digits 1-9 on a standard number pad: 789 456 123 If the number does not appear, output a falsy value. The exact 65 numbers you need to outpu...
In your favorite programming language, create an application that restarts itself once, after n seconds. You need to find a way to restart after exiting the program. EG: run cmd to do it for you. Make sure it waits an amount of seconds specified by the user before restarting For clarification: You can run a second prog...
Some versions of the standard Android calculator app allow you to press a key, like 'sin' and then the 'del' key to make it 'si'. Probably just a bug which they can't be bothered with removing. The following letters/letter groupings are typable: sin si s cos co c tan ta t ln l log lo e So, 'tasteless' is typable,...
I keep hearing that thinking outside the box is a goal worth achieving, but how can I tell if I'm successfully doing it? To solve this dilemma I have already wrote a Brainwave-to-ASCII-translator which in theory should produce outputs like # +------------+ # | thinking | # | ...
A continuation of Inverse Deltas of an Array Your task is to take an array of signed 32 bit integers, recompile it with its deltas reversed. Example The List, 18 19 17 20 16 has the deltas: 1 -2 3 -4 which, when reversed, yields: -4 3 -2 1 then when recompiled, using yields: 18 14 17 15 16 whi...
Introduction Consider a sequence of integers and one of its subsequences, say A = [4 2 2 4 4 6 5] and B = [2 4 5]. We want to remove the elements of B from A in order, and there are several ways of doing that: A = 4 2 2 4 4 6 5 B = 2 4 5 -> 4 2 4 6 A = 4 2 2 4 4 6 5 B = 2 4 5 -> 4 2 4 6 A = ...
All-pairs shortest paths is a standard pathfinding problem. This is a twist on that. Definitions We are searching for paths on a directed graph. Graphs are defined by square matrices, for example 0 3 2.5 1 0 1 0 -1 0 Write M(r,c) = value in M at row r, column c is the cost to travel from node r to node c. The gra...
Your goal is to create a program. It must take input indefinitely. Here is a sample run (the > shows that the line is the output from the program) 2,6 > 0 5,6 > 0 7,5 > 0 2,7 > 1 Since 2 is connected to 6, which in turn is connected to 5 and then 7, 2 and 7 are hence connected. 5,2 > 1 ... Clarifications Whenever t...
Given a number and either "+" or "*", return an addition or multiplication table with the dimensions of that number. Specifications The input will be formatted as dimension, operation. The program should not return anything if the operation input is not + or *. The program should not return anything if the dimension i...
We've all seen those online "maths hax" that look like this: Think of a number, divide by 2, multiply by 0, add 8. And, by magic, everyone ends up with the number 8! Language Let's define a programming language which uses the syntax of the text above, called "WordMath". WordMath scripts follow this template: Think of...
Binary to decimal converter As far as I can see, we don't have a simple binary to decimal conversion challenge. Write a program or function that takes a positive binary integer and outputs its decimal value. You are not allowed to use any builtin base conversion functions. Integer-to-decimal functions (e.g., a functio...
Introduction and Credit Imagine you're Amazon. Imagine you have a large number of products for which a lot of people have written reviews scoring 1-5 stars. Now you need to give your customers a summary for each product based on the simple product-scoring association. Because you're Amazon, time is money and as such yo...
Display a Digital Clock (I see there are many clock challenges, I have tried to read them all, I'm pretty sure this is unique) Write some code that continuously updates a digital clock displayed in the format h:m:s where h, m, and s can occupy 1 or 2 characters each. The restrictions in simple terms as @BlueEyedBeast p...
Implement this recurrence relation as a function or program that inputs and outputs a non-negative integer: F(0) = 0 F(N) = the smallest integer greater than F(N-1) such that the sum and/or product of its base-10 digits is N N is your program's input and F(N) its output. To be clear, the sum of the digits in a number...
We are putting balls into a fixed number a bins. These bins begin empty. Empty bin (a=4): 0 0 0 0 And one by one we add balls to the bins. 0 0 0 1 or 0 0 1 0 or 0 1 0 0 or 1 0 0 0 We need a quick way to loop over all the possible states the bins take, without duplicates and without missing any and we don't want t...
My wife is very, let's say, particular when it comes to putting ornaments on our Christmas tree. Let's get her some code to help her in this trying time. Input Given an input 2 < n < 10 the height of the tree and 0 < k < n the distinct number of ornaments. Task Decorate the tree starting with 1 and increment to k as we...
Skittles are colored candy where there are 5 distinct flavors; grape, green apple, lemon, orange, and strawberry represented by (p)urple, (g)reen, (y)ellow, (o)range, and (r)ed respectively. I used to eat skittles by sorting all the different colors, then eating them in sequence. After getting a few weird looks in the ...
You're looking at an avenue, and someone has left the trash out! You need to write a program to help fix the problem, by putting the trash into trashcans. The task The avenue is made up of a string of printable ASCII characters, e.g.: [[](dust)[]] car ((paper)vomit) (broken(glass)) [[] (rotten) fence (dirty) Some of t...
This is an answer-chaining challenge in which each answer builds on the previous answer. I recommend sorting the thread by "oldest" in order to be sure about the order in which the posts are made. Note: This has become quite a long-lasting challenge, and posting new answers is fairly difficult. As such, there's now a ...
A pangram is a string that contains every letter a-z of the English alphabet, case-insensitive. (It's OK if the pangram contains more than one copy of a letter, or if it contains non-letter characters in addition to the letters.) Write a program or function whose input is a list of strings, and which outputs one or mor...
Remember the good old days when opening a simple document or web page was painfully slow as it hogged all the meager resources your computer had? And today, doing the same is even slower, despite your processor being hundreds of times faster and having access to thousands of times more memory? To simulate the effect of...
I've been working on this iOS app recently and I encountered a (rather easily solved) problem: How do I determine if my string is comprised only of emojis? Well, that's your job today! Input A string. If the presence of unicode characters is problematic for you then you may use a different reasonable format. Please st...
Question Santa must get to every house in the world to deliver gifts, can you make a program that will calculate the shortest path that Santa could take, and still visit all the cities listed? Specifications The program should accept Santa's starting point as input. That could either be a city or a pair of coordinates....
I was just playing the board game Sorry! with some people, and I realized that I could base a few interesting challenges off of it. This one is pretty simple. You task is simply to output an ascii-art version of a sorry board, placing pieces where I tell you to. Specs First, here is an image of an actual Sorry! board f...
To simulate a zombie invasion, start with a grid of # and representing the map: ## ## ### # ## ## # ### # #### # represents land. represents water. The zombies start at a point on the map... ## ## ### # ## %# # ### # #### ...and spread. % denotes land infected by zombies. However, zombies cannot...
Typically, polyglots are constructed in such a manner that each language can ignore parts of the code that are present for other languages, by wrapping them in string literals, using comment syntax, or other similar tricks. Your goal is to write a polyglot where the output for each language is the code from the polyglo...
Generate me a QFP chip! From the sandbox! QFP is a type of form factor for an electrical component where pins come out the sides of a chip. Here are is a picture of a typical QFP component: you can see that the general formula is to have 4 sides of equal numbers of pins. Your challenge is to create a program that tak...
Write a program to draw a 2-D diagram of a knot based on the knot's structure. A knot is exactly what it sounds like: a loop of rope that's tied up. In mathematics, a knot diagram shows where a piece of rope crosses over or under itself to form the knot. Some example knot diagrams are shown below: There's a break in t...
What is the smallest possible runnable Mach-O executable on x86_64? The program can do nothing (not even returning a return code), but must be a valid executable (must run without errors). My try: GNU Assembler (null.s): .text .globl _main _main: retq Compilation & Linking: as -o null.o null.s ld -e _main -macosx...
Introduction: A Dutch BSN (BurgerServiceNummer) is valid when it complies to the following rules: It only contains digits. The length should be either 8 or 9 in length. When the digits are indexed as A through I, the result of the following sum: 9xA + 8xB + 7xC + 6xD + 5xE + 4xF + 3xG + 2xH + -1xI (NOTE the -1 instead...
Inspiration.* I cannot believe we have not had this challenge before: Task Given one or more printable ASCII strings, interleave them by taking one character from each string, cyclically until out of characters. If a string runs out of characters before the others, just skip that one from then on. Examples SIMPLE gives...
The problem is taken from this comic: http://www.smbc-comics.com/?id=2874 Your program must convert a number to the smallest base system in which it has the most fours in its digit sequence. Shortest code wins! Function entries are allowed provided that the function prints the base in which the number is fouriest as w...
As code-golfers, we're not used to releasing (surely). We're gonna need a few tools to help us do that. Of course, to help marketing a new release, we need a nice and shiny Release Version. Who doesn't get excited when they hear about version 3.0.0? Task Your task will be to write a program/routine/... to increment a v...
Make a fake loader just like this : Parameters : Display loading (space) one of these cyclically-\|/ (space) (percentage counter from 0-100) then a %. The percentage counter is supposed to increment by 1 every time the display changes. The time taken by counter to jump to next iteration is random. Any kind of ra...
You're given a non-empty list of positive integers, e.g. [6 2 9 7 2 6 5 3 3 4] You should rank these numbers by their value, but as is usual in leaderboards, if there is a tie then all the tied numbers get the same rank, and an appropriate number of ranks is skipped. The expected output for the above list would theref...
A ragged array is an array where each element is an array of unknown number of positive integers. For example, the following are ragged arrays: [[1,2,3],[4],[9,10]] Shape: 3,1,2 [[1],[2],[3]] Shape: 1,1,1 [[1,2,3,4,5,6,8]] Shape: 7 The following are not ragged arr...
The Task Write a program or function that, when passed a numerical input x, prints or returns the primes beneath the square root of x1 that are not factors of x. Examples Let f(x) be the function called: >>> f(4) [] >>> f(5) [2] >>> f(20) [3] >>> f(60) [7] >>> f(100) [3, 7] >>> f(10000) [3, 7, 11, 13, 17, 19, 23, ...
The Problem You must write a program that, when the Konami Code is typed in during runtime, prints the string "+30 lives" and sounds a noise of your choice from the computer's speaker. Definition The "Konami Code" is defined as UUDDLRLRBA followed by pressing the enter key. The Rules You may choose to use the up arrow...
Partition an n X n square into multiple non-congruent integer-sided rectangles. a(n) is the least possible difference between the largest and smallest area. ___________ | |S|_______| | | | L | | |_|_______| | | | | | |_____|___| |_|_________| (fig. I) The largest rectangle (L) has an area of 2 * 4 = 8, and ...
Introduction Let's define a new arithmetical operation, which I call zipper multiplication. To zipper multiply two nonnegative integers, you add leading zeros to make the lengths match, multiply the corresponding base-10 digits of the numbers, add leading zeros to the results to get 2-digit numbers, concatenate them, a...
Choose any five characters your language supports. There are 5! = 5×4×3×2×1 = 120 ways these can be arranged into a 5-character string that contains each character once; 120 permutations. Choose your characters such that, when each of the 120 strings is run in your language, the 120 outputs produced will be as many uni...
It's holiday season. A mall is empty except of air, money, and a very clever thief that is you. The mall consists of n floors. Each floor can be represented as a rectangular 2D grid. All floors have the same 2D dimensions. You are somewhere inside the building. Your job, as a hard-working thief, is to collect c coins a...
Given an integer n > 9, for each possible insertion between digits in that integer, insert an addition + and evaluate. Then, take the original number modulo those results. Output the sum total of these operations. An example with n = 47852: 47852 % (4785+2) = 4769 47852 % (478+52) = 152 47852 % (47+852) = 205 47852 %...
Background Summer is well over in the Northern Hemisphere, and a lot of us miss the sun, the beaches, the waves of the ocean... This challenge aims at cheering them up by reminding them of the sea. The challenge Here is the sea : ** ** ** ** ** ...
Introduction and credit Assume you're a bartender. You have many happy people in your bar at most times, but many only ever drink the very same drink and too few for your taste and you want to change that. So you introduce a system where the price of a drink is variable, depending on how many have already been sold, bu...
Kuznetsov's Sequence (I made the name up, don't bother with Wikipedia or Google) Given any number n > 0, let r represent the reverse of the number n. Iterate until the final result is zero, passing the result of each iteration back into the function using recursion or a methodology of your choice by performing the bel...
The 16-color CGA palette (also known as the HTML colors) is a set of 16 colors used by early graphics adapters. The goal of this challenge is to output all 16 of them, in hex format (RRGGBB), in ascending order by hex value, separated by newlines. Thus, the output should be exactly this: 000000 000080 0000FF 008000 008...
You are given a bunch of ASCII test-tubes, your task is to reduce number of test-tubes used. Each test tube looks like this: | | | | | | |~~| | | | | | | | | |__| Obviously, ~~ is the water level. Test-tube can be also empty, in which case there are no ~~ characters inside. Single tube can contain up to 8 water...
Your goal is to write some code that will output the shortest unique decimal sequence for the input fraction. No two fractions with the same denominator may have the same output, although it's possible for fractions with different denominators to have the same representation. Take 2 integers as input, the first is the ...
People on this site really love to embellish their post titles... Stewie's sequence: + * - / + * - / However, when this title needs to be included in the page URL, it is simplified: stewies-sequence The Challenge Your task is to create a program or function which, given a string representing a post title, outputs/re...
Make a code that takes a list and a number as input, and generates all possible combinations with the length of the number. For example, with the list {0,1} and the number 2: 00 01 10 11 Your program doesn't have to expect characters twice or more often in the list, such as {0,0,0,0,0,1,1,5,5} Make sure you print the ...
Given is any integer x > 0 and any base y > 3. Sum all digits of x (if written in the set base). Multiply this by the highest possible digit (is always base -1). Repeat until this value is (y - 1) ^ 2 Searched is the count of iterations and the steps. Example 1: x= 739 y= 7 searched: (7 - 1) ^ 2 = 36 based: (b7)2104...
Given two nonnegative integers n,k such that 0 <= k <= n, return the binomial coefficient c(n,k) := (n!) / (k! * (n-k)!) Test cases Most languages will probably have a built in function. c(n,0) = c(n,n) = 1 for all n c(n,1) = c(n,n-1) = n for all n c(5,3) = 10 c(13,5) = 1287 Related challenges Catalan Numbers Compu...
Based on THIS question. Given a string, replace each bracket ()[]{}<> with a bracket of the appropriate type so that the brackets match, and the nested brackets cycle as follows: Outermost ones are () Directly inside of () should be [] Directly inside of [] should be {} Directly inside of {} should be <> Directly in...
A secondary number is a positive integer whose prime factors (without multiplicity) are all less than or equal to its square root. 4 is a secondary number, because its only prime factor is 2, which equals its square root. However, 15 is not a secondary number, because it has 5 as a prime factor, which is larger than it...
In the decimal representation of every rational number p/q, you have a periodic tail, a non-periodic head, and a section before the decimal point in the following format: (before decimal point).(non-periodic)(periodic) Some examples include: 1/70 = 0.0142857... = (0).(0)(142857) 10/7 = 1.428571... = (1).()(428571) ...
Your task is to write a program that makes your screen appear to have a bad pixel. You should choose exactly one pixel on the screen, and exactly one channel between red, green and blue, and make its value either always 0 or always maximum (usually 255). The values of other channels should be the same as if your progra...
Concept Write a program that outputs code in its programming language. That code, when executed, must output the original program. Rules Since this is a cheating quine, you can read the original source code. First output program must be in the same language as the original program. You may not output a regular quine. ...
Using ASCII print a section of a hexagon ring tiling. Here's a small section: /\__/\ /_/ \_\ /\__/\ \__/ /\__/\ /_/ \_\/__\/_/ \_\ \ \__/ /\__/\ \__/ / \/__\/_/ \_\/__\/ /\__/\ \__/ /\__/\ /_/ \_\/__\/_/ \_\ \ \__/ /\__/\ \__/ / \/__\/_/ \_\/__\/ \ \__/ / \/__\/ Here's a larger...
Fermat's last theorem says that there there are no positive, integral solutions to the equation a^n + b^n = c^n for any n>2. This was proven to be true by Andrew Wiles in 1994. However, there are many "near misses" that almost satisfy the diophantine equation but miss it by one. Precisely, they are all the greater than...
Introduction In this challenge, you are given as input the ASCII representation of the net (unfolded surface) of a rectangular cuboid (3D box). The format is this: ....+--+....... ....|##|....... ....|##|....... ....|##|....... +---+--+---+--+ |###|##|###|##| +---+--+---+--+ ....|##|....... ....|##|....... ....|##|.......
Challenge Given a tic-tac-toe board in any format, determine if it is valid or not. If a board can be the result of a tic-tac-toe game, then it is valid. For example, this board is valid:X O X O X O X O XOn the contrary, this board is invalid: X X X X X O O O O Input A full (9/9) tic tac toe board (the outcome, not th...
Introduction Bob likes to have different passwords for each website he uses. He wants passwords in a special format so that he can remember. Help him by building a password generator which is as short as possible in code length, because he likes keeping stuff short just like his name. Challenge Build Bob a password gen...
The Cornu Spiral can be calculated using Feynman's method for path integrals of light propagation. We will approximate this integral using the following discretisation. Consider a mirror as in this image, where S is the light source and P the point where we collect light. We assume the light bounces in a straight ray f...
Create a script that, when run from a console, will display the text already in the console, prior to running. Challenge How will the winner of the challenge will be determined? The golf with the shortest length (in bytes) will win. Example Input and Output Input: (Shown is Windows) Microsoft Windows [Version 10....
This question was profoundly inspired by Joe Z's question. But, with a twist... So, now that it's almost 2017, it's time for a code question involving the number 2017. Your task is to make a program that counts up from 0, printing each number until it reaches 2017. without using any of the characters 012345678 or 9 in...
... Not that you would, would you? The task is simple, output the following text: ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ________ ||` |||1 |||2 |||3 |||4 |||5 |||6 |||7 |||8 |||9 |||0 |||- |||= |||BS || ||__|||__|||__|||__|||__|||__|||__|||__|||__|||__|||__|||__|||__|||______|| |/__\|/__\...
Roll cakes are delicious sweets made with a layer of sponge cake, a layer of cream (or icecream), rolled as a spiral, see Wikipedia. Your task is to get a non-empty phrase string from standard input, strip the spaces out, and roll it as a roll cake starting from the center in right to left in a counterclockwise directi...
Your program has to take a multi-lined string, like this: ############# # # # p # # # ############# p is the player and # is a block. Now under that in the terminal should be an input line saying: How do you want to move? If the player types l he has to walk left when there isn't a block...
Today, we'll be generating a map for a roguelike RPG! Example Map: ########## #### F# #### ## ## C#C# # ## # # C #E # #### # # # # #P # ########## # are walls, P is the player's starting location, F is the finish that must be reached, C are coins that can be collected, and E are enemies t...
Scenario One of your friends is struggling on a homework assignment. He needs a simple program which prints the first 404 natural numbers: 1 2 3 4 5 6 7 8 9 10 11 ... 401 402 403 404 Your challenge is simple: write this program for him. However, your connection is terrible, so 1 random character is lost every time you...
A straight-chain alk*ne is defined as a sequence of carbon atoms connected by single (alkane), double (alkene), or triple bonds (alkyne), (implicit hydrogens are used.) Carbon atoms can only form 4 bonds, so no carbon atom may be forced to have more than four bonds. A straight-chain alk*ne can be represented as a list ...