instruction
stringlengths
34
53.1k
Task Print 0 if an n*m maze cannot be solved Print 1 if an n*m maze can be solved (in 1 or more ways) (so I'm not asking for paths but if it's possible to solve!!!) Example Input array(2d): [[0,0,0,0,0,0,1],[0,0,0,0,0,1,0],[0,0,0,0,1,0,0],[1,0,0,0,0,0,0]] XXXXXXXXX XS XX X X X X X X XX FX XXXXXXXXX ...
The diamond square algorithm is a fractal terrain (heightmap) generating algorithm. You can find a nice description how it works here: http://www.gameprogrammer.com/fractal.html (Used as a reference.) http://www.playfuljs.com/realistic-terrain-in-130-lines/ (Great JS implementation, perhaps you might want to steal his ...
A De Bruijn sequence is interesting: It is the shortest, cyclic sequence that contains all possible sequences of a given alphabet of a given length. For example, if we were considering the alphabet A,B,C and a length of 3, a possible output is: AAABBBCCCABCACCBBAACBCBABAC You will notice that every possible 3-charact...
You will choose m languages and write n programs in each language, each with length n*m. The kth program should output the kth character of each program, ordered by the program number. For example, in this submission (for demonstration only; they can be any characters including newlines and tabs): ABC DEF GHI Program ...
The Scream™ Winter Sale is on and you just nabbed yourself an intense minimalist action game, Super Square. Upon playing it, you come to the realisation that either the game's just ridiculously hard or you're just really bad at it. In particular, there's this "rain" pattern that seems to get you every time... Frustrat...
Someone has been hastily stacking the Christmas presents, and it's quite a mess: ======================== | | ======================== ============= | | | | | | | | | | | ...
There's the old, well hashed version of the question that uses Dynamic Programming to calculate the minimum number of coins to reach a target value, but what if the coins you're given can't reach the target (such as {4, 8, 12} trying to total 33)? What if you're satisfied with "close enough" totals? It seems to me that...
My teacher gave me a simple problem which I should solve with a code tiny as possible. I should print all odd numbers from 0 to 100000 into a HTML document using javascript. for(var y = 0; y < 100000; y++){ if(!(y % 2 == 0)){ document.write(y + " "); } }; Is it possible to do that shorter?
Your program/function should output exactly one integer output any integer with positive probability output an integer greater than 1.000.000 or less than -1.000.000 with at least with 50% probability. Example outputs (all must be possible): 59875669123 12 -42 -4640055890 0 2014 12 24 -7190464664658648640055894646646...
Your task, if you accept it, is to make a string generator that generates strings based on a wildcard. You can make a function or a full program that receives 1 argument and sends to the standard output/console a string that matches. Wildcard characters and sequences: * produces 0 or more random characters ? produces ...
The number of partitions of an integer is the number of ways that integer can be represented as a sum of positive integers. For example: 5 4 + 1 3 + 2 3 + 1 + 1 2 + 2 + 1 2 + 1 + 1 + 1 1 + 1 + 1 + 1 + 1 There are 7 ways to represent the number 5, therefore 7 is the partition number corresponding to the number 5. Parti...
This question is based on the number-placement puzzle Towers (also known as Skyscrapers), which you can play online. Your goal is to take a solution to the puzzle and determine the clues -- the numbers of towers visible along each row and column. This is code golf, so fewest bytes wins. How Towers works The solution to...
Okay, so yesterday was 2nd Christmas day and my (grand)parents and me had a game of "sjoelen", as it is called in the Netherlands. The inner programmer came up in me, but just when I had the answer, I lost it. I want you to remake it. The rules: You have a wooden plank, a sjoelbak, with 4 boxes, each with their own num...
Story Long time ago Bobby created a Bitcoin wallet with 1 Satoshi (1e-8 BTC, smallest currency unit) and forgot about it. Like many others he later though "Damn, if only I invested more back then...". Not stopping at daydreaming, he dedicates all of his time and money to building a time machine. He spends most of his t...
In this challenge, your task is to construct an undirected graph from a sequence of directives. There is one directive for each nonnegative integer, and each transforms a given graph into a new one. Directive 0: Add a new disconnected node. Directive 1: Add a new node, and connect it to every existing node. Directive ...
You are given a machine with two 16-bit registers, x and y. The registers are initialized x=1 and y=0. The only operation the machine can do is addition modulo 65536. That is: x+=y - x is replaced by (x + y) mod 65536; y is unchanged y+=x - similarly for y x+=x - x is replaced by 2x mod 65536; legal only if x is even ...
In a very unusual accident involving a small sample of radium, an electrocuted whale, and three gummy bears, some of The Management™'s source code has been mutated. Little does The Management™'s boss know, it was actually the Cops© who had been responsible, in an attempt to thwart The Management™'s "evil" plans. So the...
This is the companion thread to the main Recover the mutated source code (link) challenge. If you have successfully cracked a cop's answer, post your solution as an answer to this question. As a reminder, here are the robber rules from the main challenge again: The robber will attempt to change the cop's program (whic...
Preface As I was shooting an archery 900 round earlier today (10 ends at 6 arrows an end, and 10 ends at 3 arrows an end, for a total of 90 arrows and a maximum score of 900), I thought of this challenge. In archery (assuming that you are shooting on a FITA supplied target face [the piece of paper that you shoot at]), ...
CONGRATULATIONS to @kuroineko for the best entry and winning the 200 bounty from @TheBestOne (excellent sportsmanship!). Write a program to colour as much of an image as possible before opposition programs do. Rules in brief Your program will be given an image, your colour, and integer N. Each turn you are sent pixel...
Mission is simple. Just output number 2015 as QR code and write it to file named newyear.png in PNG format. Code must be valid any day, so maybe you shall not use current year. QR code as text looks like this: # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ...
Background You are working for some board-game manufacturer and need to produce wooden tiles with the numbers from 0 to n engraved on them for some game. However, without further ado, some tiles would become indistinguishable, e.g., 6 and 9. To avoid this, you have to equip numbers that can be confused with others (and...
The game BattleBlock Theater occasionally contains a puzzle which is a generalised version of Lights Out. You've got three adjacent blocks, each of which indicates a level between 1 and 4 inclusive with bars, e.g.: | |||| || If you touch a block, then that block as well as any adjacent block will increment its level (...
This is a loose continuation of my earlier challenge on constructing graphs. Background An eccentric artist has hired you to estimate the structural integrity of his sculptures. He creates his works of art by taking a bunch of cube-shaped magnets, and dropping them one by one into a huge pile. To better analyze his met...
This challenge was inspired by a question on Mathematica.SE. Say you've got a nested list/array of some arbitrary structure (the lists at each level don't necessarily have the same length). For simplicity, we'll assume that the nodes are non-negative integers or empty arrays. As an example [[[1, 3], 2], [1, 4], 12, [[0...
In the Futurama episode The Prisoner of Benda members of the crew swap bodies with each other, with the catch that no pair of bodies can have their minds swapped more than once. Challenge Write a program or function that accepts a valid collection of mind-body swaps that have already occurred, and outputs a legal set o...
It is December 2014, and 2015 has almost started. However, it appears not everyone has realized this. But the people of PPCG come to the rescue! Input Your program is given a grid like the one one the wall, where days that are in the month December look different from those in November and January. Each week starts wi...
So, now that it's 2015, and a bunch of answers from last year's puzzle are now starting to produce invalid output, it's time for a question involving the number 2015. Except... why? Wouldn't you like it if your date-based answers to last year's problem were to stay valid? Why don't we change our calendar so that it's n...
A good resolution for 2015 is to live more sustainably. We'll start by recycling. Recycling code, that is! Your task is to print the number 2015 to STDOUT, with or without trailing newline (and only that). However, you have to do so by recycling some old code from PPCG. Here is how that works: Pick any answer posted o...
This is Weekly Challenge #1. Theme: Audio Processing Your task is to write a program, which writes an audio file to disc (in a format of your choice), which contains the Morse code for 2015, i.e. ..--- ----- .---- ..... You are free to choose any sort of sound for the segments, like a single-frequency sine wave, a cho...
Let's play a one-player game called jump the array. To play, you only need an array of integers, say a. You start at some position i, and on each turn, you jump to a new position. On turn n, if n is even, you jump to the absolute position a[i] mod length(a), if n is odd, you jump to the relative position (i + a[i]) mo...
In the game of Freecell, you are tasked with building four foundation piles in suit from ace to king, on a layout where you build downward in alternating colours. However, you can only build one card at a time, so you are given four "free cells" each of which can contain one card to help you move entire sequences. The ...
For example, in traditional web hexadecimal, a certain base-16 number represents an RGB value. For example, 45A19C equals (69,161,156) in RGB. You'll be converting from that number to RGB value, however, instead you'll be given that number in base-10 rather than base 16. So in the example used above, 45A19C would equa...
The most recognizable sliding puzzle is the fifteen puzzle. It has a 4 by 4 grid, 15 tiles, and one empty grid space. The tiles can only move into the empty space and must always be in line with the grid. Let's define a generalized sliding puzzle as a two-dimensional W wide by H high grid (W, H both positive integers) ...
Background In this challenge, a partition of a set S means a collection of nonempty subsets of S, which are mutually disjoint and whose union is S. We say that a partition p is finer than another partition q (and q is coarser than p), if it can be obtained from q by splitting some of its sets into smaller pieces. The j...
As the band's roadie, you have to pack the truck. Your program will place the packages so that they fit in the smallest height. A badly packed truck Rules Packages may be rotated through multiples of 90 degrees. Packages may touch but must not overlap. The output is the repacked image (to file or stdout). Your program...
Introduction You are a friend of a curator for an art museum, who has had the recent delight of getting modern art from four artists (some of which may give the curator zero pieces of art, young scoundrels). As this is modern art, all of any given artist's pieces look exactly the same. Your friend wants to use a comp...
Objective You are to write a program that receives an integer n as input (from the command line), and embeds itself (the program) n directories down the directory tree. Example with n=5: The folder names may be whatever you wish. The only requirements are that the depth is correct, and that the program can then be ran...
In a puzzle in an old book of mine, a game is defined in which two players choose sequences of coin flips that they believe will appear first when a coin is repeatedly flipped. (It was actually odd and even dice rolls, but this little detail doesn't matter in terms of problem equivalence.) It is noted that if player 1 ...
The Puzzle You have to write a program or function p(n) that returns the square of what is entered into it and you may assume that the input is a non-negative integer. Put in simpler terms, return n2. Rules You are not allowed to use * or / (or any other power or square root operator, such as POW or SQRT, if your lang...
Challenge Your challenge is to design an interpreter for a lisp-like language, which will from hence forth be coined: GLisp. The program code for GLisp will consist of an arbitrary amount of nested expressions denoted by brackets, in the following form: (func arg1 arg2 ...) Note that the interpreter must allow for ext...
The task is simple. Get me some 1000, 500 and 100 notes. How ? you might ask. Don't worry, no need of robbing a bank as there is an ATM nearby which accepts your credit card. But your credit limit is just enough for the task so you have to be careful with the withdrawals. Challenge Given the number of 1000, 500 and 100...
The paint on the walls in my room has a random, almost fractal-like, 3-dimensional texture: In this challenge you will write a program that generates random images that look like they could be part of my walls. Below I've collected 10 images of different spots on my walls. All have roughly the same lighting and all we...
Stroustrup has recently posted a series of posts debunking popular myths about C++. The fifth myth is: “C++ is for large, complicated, programs only”. To debunk it, he wrote a simple C++ program downloading a web page and extracting links from it. Here it is: #include <string> #include <set> #include <iostream> #includ...
This is the reverse of Music: what's in this chord?, which is to print the notes in a given chord. This time the input is a list of notes in a chord, and your task is to output which chord it is. Your program should support the following triadic chords. Examples are given with root C. Chords with other roots are the sa...
You are sick of all of the codegolf challenges. Hence you decide to write a program that will automatically golf some Python code for you. There are 3 test cases: print quickSort([0,7,3,-1,8,10,57,2]) def quickSort(arr): less = [] pivotList = [] more = [] if len(arr) <= 1: return arr else:...
Nontransitive dice are nice little toys that defy our intuition in probability theory. We'll need a few definitions for this challenge: Consider two dice A and B which are thrown at the same time. We say that A beats B if the probability of A showing a larger number than B is strictly greater than the probability of B ...
Write program or function which will take left and right value of dice as integers (1-6) and return value on top. Dice layout: +---+ | 1 | +---+---+---+---+ | 2 | 3 | 5 | 4 | +---+---+---+---+ | 6 | +---+ ,^. <´ 5 `> <-- Top value |`._,´| .6 | 4, <-- Side values `.|,´ So inputting 6 4 will return...
Consider an array of bits, say 1 1 1 0 0 0 0 1 0 0 1 0 1 1 1 1 1 0 1 0 We call a contiguous subarray of length ≥ 5 a phase if at least 85% of the bits are the same and the first/last bits are both equal to the majority bit. Furthermore, we call a phase maximal if it is not a strict subarray of some other phase. Here a...
This question is inspired by retrograde music. Retrograde music is a piece of music that can both be played normally (from the beginning to the end) as reversed (from the end the beginning). A similar thing exists in literature, this is called a semi-palindrome, e.g. "roma" and "amor". Your task is to write a retrograd...
You are Desmond Hume. For the last 3 years, you and your partner, Kelvin, have been slave to a computer that requires a very specific sequence to be entered into it every 108 minutes to save the world. 4 8 15 16 23 42 Your partner died 40 days ago (due to an unfortunate accident involving Kelvin's head and a big rock)...
In this contest you have to write a program, that accepts a black and white pixel image, and tries to alter it, such that the white shape forms star domain, with as few changes as possible. Allowed changes are turning white pixels into black ones and turning black pixels into white ones. The output must again consist o...
This is Weekly Challenge #2. Theme: Translation Write a program or function that takes in source code for a program in Prelude and outputs code for an equivalent program in Befunge-93. For the program to be equivalent, it should, for any given input, produce the same output as the Prelude program, and halt if and only ...
Is it possible to make this C code smaller? It prints out all primes from 0 to 1000. C, 89 chars int i,p,c;for(i=2;i<1e3;i++){c=0;for(p=2;p<i;p++)if(i%p==0)c++;if(c==0)printf("%u\n",i);}
Program your robots to deliver packages in a warehouse infested with destroyer drones. Avoid the drones and get your packages to the right place as fast as you can. Delivery Robots There are packages labeled a-z in a warehouse. Packages must be delivered to a matching chute A-Z. A robot cannot move to a square that co...
A little context: Book has 411 Pages Read a random number of pages on the first day which is unknown Number of pages to read next day is the square of the sum of the digits of the page currently on I.e. on Page 36: read 81 pages next day On day 6 The square answer directly adds to current page number to make 411 Fini...
Your task is to take the following simple C code and make a program which will interpret this code and produce a correct output, and be able to handle small modifications to the original code. The C code is int x = 4; int y = 5; int z; z = x * y; if(z>10) { printf("%d is bigger than 10!",z); } Or as one line of ...
Background In this challenge, a base-b representation of an integer n is an expression of n as a sum of powers of b, where each term occurs at most b-1 times. For example, the base-4 representation of 2015 is 4^5 + 3*4^4 + 3*4^3 + 4^2 + 3*4 + 3 Now, the hereditary base-b representation of n is obtained by converting t...
Your challenge is, given a series of notes, print the fingerings that minimize the amount of movements you need to make (explained below). My not standard way of transforming fingerings to text: The | line separates the left and right hand. Use 1 for the index finger, 2 for the middle finger and 3 for the ring finger. ...
Our new bank needs a teller transaction system but there is a problem. There is only a few hundred bytes of space left on our server, so you will have to write very compact code. Database Thankfully our database is very simple (it was built by the schoolboy son of our bank president), and we only have a few customers s...
In many image-processing challenges, the post contains images, which must be saved to a file in order to be able to work on the problem. This is an especially tedious manual task. We programmers should not have to be subjected to such drudgery. Your task is to automatically download all the images contained in a Code ...
I want to try a new form of code golf here. Similar to bonuses, not all parts of the challenge have to be completed, but each answer has to implement a subset of certain size (and there is a core that every answer has to implement). So besides the golfing this challenge also involves choosing a set of features that go ...
Introduction The game takes place in a small world with different towns. The rulers of the towns hate each other and would like to rule the world. The people are divided into two groups, warriors and lowborns. However, lowborns can raise to warriors. You are the ruler of three of these towns. Gameplay When the game beg...
In this challenge, your job is to find the straightest path from point A to point B in a two-dimensional maze. This is very similar to finding the shortest path, which has been done to death, but instead of minimizing the length of the path, you minimize the number of turns (or angles or corners, whatever you want to c...
Background Alice and Bob play a game called construct a binary word. To play the game, you fix a length n >= 0, a set G of length-n binary words called the goal set, and a length-n string t containing the letters A and B, called the turn order. The game lasts for n turns, and on turn i, the player defined by t[i] selec...
All good coders know some good sorting algorithms like quicksort or merge sort. There is also slow sorting algorithms, e.g. bubble sort and insertion sort. But those are such easy to implement and so, so efficient. Too efficient. Your task is to create very slow sorting algorithm. Please attach the Big O notation of y...
Consider a piece of string (as in "rope", not as in "a bunch of characters"), which is folded back and forth on the real line. We can describe the shape of the string with a list of points it passes through (in order). For simplicity, we'll assume all of those points are integers. Take as an example [-1, 3, 1, -2, 5, ...
Challenge You must, in the least bytes possible, implement the Binary Heap data structure and each of the following methods that operate on it: A function which takes no arguments and returns an empty Heap A function which takes a list of arguments with an arbitrary length and returns a Heap containing the elements A ...
Background You have just learned what combinatory logic is. Intrigued by the various combinators you spend quite a bit of time learning about them. You finally stumble upon this particular expression: (S I I (S I I)) You notice that when trying to reduce it to its normal form, it reduces to itself after three steps: (...
Cops' Thread In this challenge, your goal is to write a function that accepts a integer N, and that function will return the first N primes. However, you must do this in the most characters possible. You may use any method you wish to produce the primes. You are not allowed to modify your code after posting. Only pri...
Robbers' Thread In this challenge, your goal is to crack some code written by the Cops (their code is here) by modifying it. You have cracked their code if: Your modified code has a maximum levenshtein-distance of 10 from theirs, and has fewer characters The function, given the same valid input, will produce the same...
Each character in this 64 by 64 block of text has been chosen randomly and uniformly from the 95 printable ASCII characters. /rq$:Zy5*g'$DeGXX2o8y "{@Cg:FR9qih}xh >5$DsF1Fs5Ao~smFp;.RJbV )U c4\(|Sx*V$10G9xO:NjHKasem%,\9[pPm@&kTaN~HC[;9`lgqlAH(7dt0a-5}LJ[ &sifw9V-.PLRoD~F'dJYA^Q)L#h>$9h!B4b&ceKp8~HndzDm#1/ySydrf5T8[Y%4 ...
Directions Write a program that, given an input integer n (n >= 0), outputs the smallest positive integer m where: n = a[1]^b[1] + a[2]^b[2] + a[3]^b[3] + ... + a[k]^b[k] a and b are finite sequences of the same length all elements of a are less than m all elements of b are less than m all elements of a are different ...
Programmers are often obsessed with drawing fractals. I think we need a new computer based medium. The H tree is a fairly simple type of fractal made of horizontal and vertical lines. Here it is at it's tenth iteration (courtesy Wikipedia): Now, imagine each of the lines in the image is a directory (folder) in a stand...
Input Your input in this challenge is a list of integer pairs. They represent the southwest corners of unit squares on the plane, and the list represents their union as a subset of the plane. For example, the list [(0,0),(1,0),(0,1),(1,1),(2,1),(1,2),(2,2)] represents the red-colored set in this picture: Output Yor o...
Notes This thread is open and unlocked only because the community decided to make an exception. Please do not use this question as evidence that you can ask similar questions here. Please do not create additional showcase questions. This is no longer a popularity-contest, nor are snippet lengths limited by the vote ...
This is my first experiment with an asymptotic complexity challenge although I am happy with answers entirely in code as long as they come with an explanation of their time complexity. I have the following problem. Consider tasks T_1, ... T_n and procs M_1, ... , M_m. Each task takes a certain amount of time to perfor...
tl;dr [True] Billy got a Stack Overflow pen from Tim Post. Billy was stupid enough to use the pen, knowing that he was not worthy. Billy's friend took the pen apart, so Billy put the pen in a drawer at his house, hoping he would eventually fix it. A year later, Billy can only find half of the pen's pieces, and not the ...
This is Fortnightly Challenge #3. Theme: Genetic Algorithms This challenge is a bit of an experiment. We wanted to see what we could do, challenge-wise, with genetic algorithms. Not everything may be optimal, but we tried our best to make it accessible. If this works out, who knows what we might see in the future. Mayb...
All those questions that are duplicates... Ignored and marginalized by society. It is just not... right. We have to do something. There surely must be love for them too. They feel appreciated if a piece of code outputs a link to a duplicate question. But the duplicate questions are not so easily impressed. They are swe...
Challenge The objective is simple, in the shortest amount of bytes, write a function or program that takes a number and prints its double factorial. The input must be taken from stdin or a function argument, and it must print the resulting double factorial to stdout. Inbuilts are disallowed
Eh! You know, the problem with us Canadians is that sometimes, after a long day of moose hunting and dam repairing, we forget our way back to our cabins! Wouldn't it be great if our handy laptop (which, is always at our side), had some way to point us home? Well, it's been long told that, if you display a compass on yo...
A move sequence is a sequence of moves (turns) on a Rubik's Cube (for the notation look down below). Beside the empty move sequence, there are many other other move sequences, that have no effect on the cube at all. We call these move sequences identity sequences. Some of these identity sequences are obvious to determ...
Every player has a number. Can yours be the farthest from them all? Requirements Write a Java, Python 2, or Ruby function named choose() that accepts three arguments: an integer - the number of rounds already completed an integer - the number of players an array of strings - the results of each previous round each s...
I love my encryption but I need a program that is dedicated to making a caeser cipher. It will take an input string and will output a ciphered text with the number to decode it. The number can be made whatever you want The shortest code wins!
Your program or function should output all the 36 4-perfect numbers in increasing order separated by newlines. An n positive integer is a k-perfect number (multiply perfect number) if the sum of its divisors including itself (i.e. the sigma function of n) equals k*n. For example 120 is a 3-perfect number because 1 + 2...
Introduction I want to find the substring with the most 1's in a sequence of 0's and 1's. Input Your program has two inputs, the sequence and the substring length. The sequence is any number of 0's and 1's: 01001010101101111011101001010100010101101010101010101101101010010110110110 The substring length is any positive ...
This is a code golf challenge. Just like the title says, write a program to covert a string of ascii characters into binary. For example: "Hello World!" should turn into 1001000 1100101 1101100 1101100 1101111 100000 1010111 1101111 1110010 1101100 1100100 100001. Note: I am particularly interested in a pyth implemen...
Using one programming language write 5 single-line programs, each of which outputs a different line of the first verse to Harry Nilsson's 1972 song "Coconut" when run individually: Brother bought a coconut, he bought it for a dime His sister had another one, she paid it for a lime She put the lime in the coconut, she ...
This a code challenge. The winner will be the person to provide the most efficient implementation of the solution in terms of algorithmic complexity. Using the dictionary found in '/usr/share/dict' (on OS X and Linux), your task is to find the word with the most anagrams of itself in the dictionary, and print all of th...
In Conway's Game of Life, a cell is in a state of either on or off, depending on the on-and-off state of the eight cells surrounding it. We can simulate this using a logic gate network with some sort of clock signal that updates every cell all at once. Your task in this problem is to build the logic gate network for a ...
This code-golf challenge is based on the following puzzle: You have an odd number of tokens whose weights are known whole numbers, and they don't all have the same weight. Show that there's a token you can remove so that the remaining tokens can't be split into two equal-size sets that have the same total weight. Her...
Older cellphones have 3 or 4 characters mapped to each number from 2-9 and that number must be pressed a certain number of times to get the required character. Let's assume our cellphone has this map: 1:1 2:abcABC2 3:defDEF3 4:ghiGHI4 5:jklJKL5 6:mnoMNO6 7:pqrsPQRS7 8:tuvTUV8 9:wxyzWXYZ9 0:<space><newline>0 If you wan...
Introduction Jim and Bob are playing badminton doubles against two other players, but mid-game they face a dilemma: After a fast-paced rally they have no idea who has to serve next and where they have to stand for the next serve. Bad enough they only know the scores in order. Rules: To help them out, you have to know t...
You have to create a function range, such that it takes two (integer) arguments a and b (a < b) and returns all the numbers in between them. So: range(5, 10) // should output 6, 7, 8, 9 range(-5, 2) // should output -4, -3, -2, -1, 0, 1 range(5, 0) // can throw an error/empty/null/undefined/whatever (a is not < b) // b...
In this pixelated font of uppercase letters of the alphabet, all the characters are 5 units wide and 5 tall. ███ ████ ███ ████ █████ █████ ████ █ █ █████ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ ██ ██ █████ ████ █ █ █ ████ ████ █ ██ █████ █ ...
You should write a program or function that receives a positive integer N as input and prints out the first N characters of your code. If N is larger than the length of your code you should continue output your code cyclically. Reading your source code in any way and reading from file, stdio, etc. are disallowed. Examp...
This challenge is to find the longest chain of English words where the first 3 characters of the next word match the last 3 characters of the last word. You will use an common dictionary available in Linux distributions which can be downloaded here: https://www.dropbox.com/s/8tyzf94ps37tzp7/words?dl=0 which has 99171 E...
For those with a little linear algebra background, the challenge is as simple as this: determine the eigenvalues and eigenvectors of a given complex 2x2 matrix. You may skip ahead to The Challenge for I/O details, etc. For those who need a little refresher on eigensystems, read on. Background The characteristic equatio...
There are P parking spaces in a parking lot, though some spaces are occupied by cars represented by octothorpes # while the free spaces are dots .. Soon there arrive T trucks, each of which will take up exactly L consecutive spaces. The trucks don't have to be parked next to each other. Your task is to create a program...