instruction
stringlengths
34
53.1k
Sort the Textbooks School is starting soon (if it hasn't already) and so it's time to get our textbooks in order. You need to sort your books in alphabetical order but that takes too long so you decide to write a program to do it. Examples Input: _ | | _ |F| | | |o|_|P| |o|B|P| | |a|C| | |r|G| |_|_|_| Output: _ ...
Definition There is infinite row of concatenated natural numbers (positive integers, starting with 1): 1234567891011121314151617181920212223... Challenge Write program in any language, that accepts position number as an input, and outputs digit from that position in the row defined above. Position number is arbitrary ...
Overview Given a number of hexagons, arrange them into a connected shape within the confines of a 50 by 50 ASCII art image. The shape you choose can be arbitrary - whatever you find most amenable to golfing - as long as it is connected. It may have holes provided they are larger than one hexagon (otherwise the number o...
Take a string as input. This string can be as long as you'd like, however, it may only include letters and spaces––no numbers, punctuation, etc. When a word is passed into your function, an image will be made out of it. This image is the input word written out using only these characters: –, /, \, and |. You do not nee...
Zeckendorf's theorem shows that every positive integer can be uniquely represented as a sum of non-adjacent Fibonacci numbers. In this challenge, you have to compute the sum of two numbers in Zeckendorf representation. Let Fn be the n-th Fibonacci number where F1 = 1, F2 = 2  and for all k > 2, Fk = Fk - 1 + Fk -...
The challenge Implement the C equivalent of the pow() function (exponentiation) for natural numbers, in a language of your choosing, using only addition, subtraction (which includes negation and comparisons), bit-shifting, boolean operations on signed and/or unsigned integers, and of course looping. (Note that this is ...
Introduction "Yarr!! We had a laddie who called himself a "programmer" make a map t' our hidden treasure! But 'tis written wit' weird numbers 'n letters! "E5, N2, E3"... what does it even mean? Madness! Can't even scribe a proper treasure map, t' useless cretin. Fix it fer us! We'll gift ye a share o' t' treasure!" Cha...
Balancing Act Overview Given an input of 3 single-digit positive integers representing a set of weights, output an ASCII representation of a seesaw with the weights placed on it so that it is in balance around a central pivot, taking lever effects into account. Each number has a weight equal to its value. The torque of...
Challenge In the shortest amount of code: Compute the length of the permutation cycle of a perfect shuffle on a deck of cards of any size n (where n ≥ 2 and n is even). Output a table of all cycle lengths for 2 ≤ n ≤ 1000 (n even). Note that there are two basic ways of defining a perfect shuffle. There is the out-shu...
Ascii Pong The challenge is to recreate the classic game "pong" in ASCII characters in the shortest code possible. Requirements/specifications The "screen" should be 45x25 characters. White space should actually be white space. The paddles should be 9 equals signs: ========= and should be on the top-most and bottom-mo...
I've been using a library called Djangular recently, which integrates Django and Angular. After a while I thought 'Wouldn't it be fun to programmatically generate portmanteau?' Here are some examples (e.g. testcases): Django + Angular -> Djangular Camel + Leopard -> Cameleopard Spoon + Fork -> Spoork Ham + Hammer -> Ha...
For a given positive integer n, consider all binary strings of length 2n-1. For a given string S, let L be an array of length n which contains the count of the number of 1s in each substring of length n of S. For example, if n=3 and S = 01010 then L=[1,2,1]. We call L the counting array of S. We say that two strings S...
Usually when performing an internet challenge, there's no problem with having to specify a user agent, but when it comes to dealing with Google, it changes. Google blacklists the Urllib user agent, presumably to stop spambots, so you have to specify a user agent. This takes up many bytes, and is frankly rather annoyin...
For the purpose of this question, a magic square is an n×n square of (not necessarily distinct) positive integers, where all rows, columns, and main diagonals add to a "magic constant" m. Your Task Create a function or full program that, given the magic number m and a list representing a square with at most one wrong n...
This question brought to you by a game I like to play when stuck in long phone meetings. Given any two times from a 24 hour clock (from 00:00 to 23:59), how many valid mathematical equations can be generated with all of the times in between using only basic arithmetic operations? Input: two four digit strings (no colon...
We have a strictly increasing sequence of non-negative integers, like: 12 11 10 Wait! This sequence isn't strictly increasing, is it? Well, the numbers are written in different bases. The least possible base is 2, the biggest is 10. The task is to guess bases each number is written, so that: the sequence is strictly ...
Cryptic Kicker A common but insecure method of encrypting text is to permute the letters of the alphabet. In other words, each letter of the alphabet is consistently replaced in the text by some other letter. To ensure that the encryption is reversible, no two letters are replaced by the same letter. Your task is to de...
Which language usually produces shorter golfed code: Pyth, CJam or Golfscript? In asking this, I do not mean which has a prettier syntax or which has the most useful commands, I mean overall, which one is usually the shortest? What types of problems would we expect each language to have an advantage in?
What tricks do you know to make CoffeeScript code shorter? CoffeeScript is language that compiles into JavaScript ("transpiles" into ES3, to be exact). The golden rule is "It's just JavaScript", meaning there's no runtime overhead. Most of JavaScript Tips & Tricks apply as well. As a side-effect that also means: develo...
What general tips do you have for golfing in INTERCAL? I'm looking for ideas which can be applied to code golf challenges and are also at least somewhat specific to INTERCAL (i.e. "remove comments" is not a useful answer). I know exotic languages can be really useful to win golf contests, but I don't see much INTERCAL ...
Context: You are a cryptographer. You have stumbled upon a mysterious group of individuals, who present you with a challenge, which you must solve in order to join their secret society. Description: You have been given a binary stream consisting of 3 byte sequences that have a random width (unchanging per-stream). T...
This is the third in a series of puzzles that I will be posting every Monday at Midnight PST, and the final variant of "Take It or Leave It". The first puzzle is located Here The second puzzle is located Here Context: A reclusive billionaire has created a game show to attract the world's best and brightest programmers...
The Compiler Language With No Pronounceable Acronym, abbreviated INTERCAL, is a very unique programming language. Among its unreproducible qualities are its binary operators. INTERCAL's two binary operators are interleave (also known as mingle), and select. Interleave is represented with a change (¢), and select is rep...
The challenge is to write a brainf*** program that searches sequentially through memory for the first NON-zero cell. The program should start somewhere in fairly low memory (there will probably be some overhead/counters/etc.). Once the program starts checking cells, it should continue to the right, checking every cell...
Overview Write a program that prints out simple fractal patterns given a bit pattern encoding the fractal, plus the per-generation scale factor of the fractal and number of generations. Explanation Here is an ASCII representation of the Sierpinski Carpet: Generation 0: # Generation 1: # # # # # # # # Generation...
You have a swimming pool that is filled to the brim with water. You need to empty it, but you can't think of an efficient method. So you decide to use your red solo cup. You will repeatedly fill the cup all the way and dump it outside the pool. Challenge How long will it take to empty the pool? Input [shape of pool] [...
Your goal is to write a program that will print out the Laplace transform of a polynomial function with integer coefficients \$f(x)\$. The Laplace transform of \$f(x)\$ is defined as \$\int_0^\infty f(x) e^{-sx} dx\$. The standard input for the polynomial function will be a+bx+cx^2+dx^3+... If the coefficient is zero,...
NOTICE - This challenge is now closed. Any new answers will be ignored and the accepted answer will not change Challenge Write a valid program which, when just two characters in the program are changed, removed or added, completely changes the output. The changed output must have a Levenshtein Distance of 15 or more ...
For the main cops' challenge, click here NOTICE - This challenge is now closed. Any cracks which are posted now will not be counted on the leaderboard and the accepted answer will not change. Challenge Given the original program, its output and the output of the changed program, you have to find out which characters ...
You need to build a pyramid from cubes. Cubes can be viewed from 2 angles: _____ _____ /\ \ / /\ / \____\ /____/ \ \ / / \ \ / \/____/ \____\/ This is an example for 2-size cubes from the 2 possible angles. The height of the cubes is $size slashes (or back-slashes), and the w...
You have N lists A = [5, 6, 10, 15] B = [3, 0, 7, 4] C = [49, 59, 29] D = [19, 29, 39] E = [9, 15, 3, 10] You have to combine them such that: Two lists which have a common elements they should be next to each other. In this case answer is: A,E,B,C,D [5, 6, 10, 15, 9, 3, 0, 7, 4, 49, 59, 29, 19, 39] E comes after A a...
Find the shortest way to generate a random number between 0-9 without repeating the last generated number. Here is an example written in javascript. var n=t=0; while(n==t){ t=Math.floor(Math.random()*9); } n=t; I don't know if it is possible, but it would be interesting if there is a solution using only one variabl...
Synopsis: Find characters that are enclosed by MYPOCKET. Example Input MYPHEIF YFOCKVH MBNDEIF TEUFTMY ESNDUWP KBOVUVO CENWFKC OPYMTEB Example Output F BND EUF SNDUW BOVUV ENWF Huh? How did we get that as an output? The "pocket" can sometimes be difficult to see. This will make it clearer: MYPHEIF YFOCK...
Prindeal (pronounced prin-dee-al) is a new esoteric programming language that only has four commands: print, increment, decrement, and alias. Despite its minimalism, complex mathematical operations can be done in Prindeal by cleverly combining the four commands. Your task in this code golf challenge is to write the sho...
Challenge Find the shortest regex that validates, i.e. matches, every possible date in the Proleptic Gregorian calendar (which also applies to all dates before its first adoption in 1582) and does not match any invalid date. Output Output is therefore truthy or falsey. Input Input is in any of 3 expanded ISO 8601 d...
Task Given the page of a book P on stdin, count all occurrences of the digits 0-9 in each member of the range 1 to P. There is no page zero and your program should handle any number less than 1,000,000. Since putting a constraint on how you can do it is difficult to explain there will be a time limit of 3 seconds inste...
Brief Print an ASCII representation of a binary search tree. You should write your own minimum implementation logic of a BST (node, left, right, insert) (50,30,70,20,80,40,75,90) gives: __50__70__80__90 | | | |__75 | |__30__40 | |__20 Detailed requirements Items are inserted ...
Challenge You've given a map to a friend that looks a bit like this: | / | / | \ | \ D A simple map that starts at the top and ends at the bottom. Sadly, your friend doesn't get it. Can you decode the map so that he can read it? Input The input is a string of characters co...
Given a list of integer coordinates, find the area of the biggest convex polygon you can construct from the list such that - every vertex is in the list no element of the list is contained within the polygon. Example: (0, 0) (8, 0) (0, 1) (3, 1) (7, 1) (1, 2) (5, 2) (9, 2) (2, 3) (5, 3) (7, 3) (3, 4) (5, 5) (11, 5)...
The Challenge: Print every 2 letter word acceptable in Scrabble using as few bytes as possible. I have created a text file list here. See also below. There are 101 words. No word starts with C or V. Creative, even if nonoptimal, solutions are encouraged. AA AB AD ... ZA Rules: The outputted words must be separated so...
Background theme Introduction Obi-Wan Kenobi, Qui-Gon Jinn and Darth Maul are about to fight! However, they've all forgotten to bring their respective lightsabers. Write a program or function which, given the string Jedi as input, generates an image similar to this*: and given the string Sith, generates an image sim...
The goal of this challenge is the write the shortest function/program to take input text, encrypt it using the method below, and return the result. As an example, I will use the string hello world. First, get the input text. hello world Second, convert the string into ternary (base 3). Use this key: a = 000 b = 001 c ...
Write a program or function that takes in a positive integer and prints or returns an ASCII art depiction of an archery arrow, scaled according to the input. If the input is 1 the output is /\ / \ \__/ || || || || || || || || /||\ / || \ / || \ // \\ / \ If the input is 2 the output is /...
The Library of Babel is defined as a universe in the form of a vast library containing all possible 410-page books of a certain format and character set. For the purposes of this question, each page of the book contains 40 lines of 40 characters each. The formatting rules are as follows: Legal characters are the...
Write a function (such as placeAt) that takes an array of non-negative integers and an index that is a non-negative integer. It should place a 1 at the given index, possibly shifting other entries by one spot to vacate that spot, with 0's standing for empty spots. If the entry at the desired index is 0, fill it with a...
Write a program that takes in (via stdin or command line) a string with the recursive form PREFIX[SUFFIXES] where PREFIX may be any string of lowercase letters (a-z), including the empty string, and SUFFIXES may be any sequence of strings with the recursive form PREFIX[SUFFIXES] concatenated together, including the e...
Just about every store nowadays uses Universal Product Code (UPC) barcodes to simplify the checking out process. If the name doesn't mean anything to you, you will surely recognize what they look like: Format The most common system is UPC-A, which uses 12 digits to represent each specific product. Each digit is encode...
I came up with this challenge independently, but it turns out to be the inverse to this challenge by Doorknob. As I really like his spec, I decided to steal large parts of it instead of cooking up my own explanations. The Challenge Given the abbreviation of one of the 32 points on the compass, print the corresponding d...
Challenge You must write a program which correctly identifies the language a passage is written in. Rules The passage will be a string passed to your program either via STDIN or function arguments. You may not use any external sources except for a local text file with words. The length of the text file must be included...
I spent all of today at a Super Smash Bros. tournament, and I started thinking about some of the terminology we use when describing sets. These are the three kinds of sets that I see played at tournaments: Best of 3 (Bo3) Three games are played. The winner of the set is the player who won the majority of the games. ...
This challenge is loosely inspired by the Zachtronics game Infinifactory. You are given a top-down view of a rectangular grid of conveyors, represented by >v<^. There may be cells without conveyors, represented by spaces. Here is an example: > <vv < v ^ >v v >v^^>vv^ ^>^ v > v<v >> >v v<^ This setup ...
When dealing with long numbers when code golfing, getting the length of your code down can be difficult, so do you have any tips for making a number shorter and easier to manage? For example, the following Pyth code prints "Hello world", but at 44 bytes, that is unsatisfactory: Vcjkj85942000775441864767076 2 7=k+kCiN2...
Congratulations to Dennis who won both the cops' and the robbers' challenge! Calvin's Hobbies has already delivered on his promise and wrote this challenge for Dennis for winning the robbers' challenge. Notice: This challenge is closed for further cop answers as of 2015-09-01 02:00:00 UTC. Any new answers posted wil...
According to this page, the best strategy to guess English hangman words is to calculate the odds of each letter in a word list that meet our conditions. But, as I'm really lazy, I don't really want to compute every word in the dictionary by myself. But, as I know that you are always here to help me, I'm sure you will ...
In this challenge, you are to draw the chessboard below, and allow for moves to be made. 1. Drawing Each white square has 5x9 spaces. Each black square has 5x9 colons. The board is surrounded by a border of colons. The pieces are 5 characters wide and sit on the bottom row of the square in the centre. The pawns are 4 c...
You work for the military as a coder and are responsible for writing software to control missiles. Your task is to write a program or function that will output a code sequence (any length ASCII string) to launch a missile. The program should be based on a loop taking the code sequence from memory and output it in a par...
Challenge: Your challenge (should you choose to accept it) is to compress and decompress the 5MB "Complete Works of William Shakespeare" as found here: http://www.gutenberg.org/cache/epub/100/pg100.txt (MD5: a810f89e9f8e213aebd06b9f8c5157d8) Rules: You must take input via STDIN and output via STDOUT... ...and you must...
What is a Word Signature? The signature of a word are all of it's letters put in order - the signatures of this, hist and hits are all hist. The Challenge Write a program program should ask for an input, then print out the signature of that word. So an example program run might look like this: Give me a string: this T...
Inspired by this question on Math.SE. Starting with 1 you can repeatedly perform one of the following two operations: Double the number. or Rearrange its digits in any way you want, except that there must not be any leading zeroes. Taking an example from the linked Math.SE post, we can reach 1000 via the following st...
You are given the RGB values of a color. Your task is simple: to calculate the hue, in the simplest definition. Say the channels with highest, middle and lowest value are X, Y, Z (which are either red, green or blue) and their values are x, y, z. The hue of this color is (h(X)-h(Y))*(1 + (x-y)/(x-z))/2 + h(Y), where: h...
Given two parameters lane pattern and road length, print an ASCII representation of the lane markings for Roads and Traffic Service to paint the roads. Example input/output Input: BTHMLRPHU, 21 I don't care if you take two parameters or concatenate the number onto the end of the string, it's unambiguous. Input may be t...
The challenge is to write the shortest function/program to find a polynomial given the roots. The function or program should take valid input; that is, a list of integers representing the roots of the polynomial, and return valid output. Output should return a sequence of numbers representing the polynomial. For exampl...
There is an app called Hard Puzzle which is a game where there is a red circle, and you have to fill all of the surface area with five smaller white circles it may seen easy, but it's harder than it looks (it just takes a while to figure out). The circle dimensions change from device to device in the image above the re...
You are given a set of logic statements. Your challenge is to remove any ones that contradict the others, but in the optimal way (i.e. removing a minimal number of statements). Challenge You will write a program or a function that takes as input a list of statements, removes the minimal number of statements such that t...
Twisting Words! Given a string and a positive integer. You must twist the string, back and forth. Example Input / Output Input Programming Puzzles & Code Golf 4 Output Prog mmar ing zzuP les oC & de G flo Input The input can be taken in through STDIN, or function argument. The input will consist of a string and a ...
Introduction In the land of [Insert cool name here], people don't buy things with money, because everyone has a severe allergy to paper. They pay eachother with words! But how is that? Well, they give each letter number values: a=1,b=2,c=3,etc. (With some other special rules that will be described later) In this chal...
This challenge is loosely inspired by the unimplemented esolang Pada. Consider an array of 8 bits, all initialised to zero. We'll introduce a very minimalistic instruction set to print arbitrary strings. There are two instructions, both of which take a parameter N which is the index of a bit: t N for toggle: This chan...
Your challenge is to take input as a line of text and output it like this. Input / output The input will be a string that contains only printable ASCII characters. The first or last characters will never be spaces, and there will never be two spaces in a row. It will always be at least two characters long. Your output...
I encountered this question in an interview and could not figure it out. I believe it has a dynamic programming solution but it eludes me. Given a number of bricks, output the total number of 2d pyramids possible, where a pyramid is defined as any structure where a row of bricks has strictly less bricks than the row be...
Sign that word 2! Not that long ago, I posted a challenge called Sign that word!. In the challenge, you must find the signature of word, which is the letters put in order (e.g. The signature of this is hist). Now then, that challenge did quite well, but there was one key issue: it was WAY too easy (see the GolfScript a...
Zig-zag strings Given a string and a positive integer, output the string in a zig-zag wave pattern with a peak amplitude and character spacing equal to the integer. This is similar to this question but also includes character spacing. Input Input can be read from STDIN or taken as function arguments. Input is a string...
Challenge Write a program to factor this set of 10 numbers: 15683499351193564659087946928346254200387478295674004601169717908835380854917 24336606644769176324903078146386725856136578588745270315310278603961263491677 39755798612593330363515033768510977798534810965257249856505320177501370210341 45956007409701555500308213...
Magic: the Gathering is a trading card game where, among other things, players play cards representing creatures, which can then attack the other player, or defend against the other player's attacks by blocking. In this code-golf challenge, your program will be in the place of a Magic player deciding how to block in co...
Write the shortest program that waits for every key of a Standard 101 key US Keyboard* to be pressed and then exits writing OK! Every time a key is pressed the program displays on a new line the remaining number of unpressed unique keys that need to be pressed until all key are pressed at least once. The program should...
Given a list of integer points in an n-dimensional space, output the geometric median. Note that the output is not necessarily integer. Your answer must be precise to at least two digits after the decimal point. You may assume that n < 16 and that every component of each point fits in a 32-bit signed integer. You may w...
Almost all operating systems allow you to run multiple programs at the same time. If your system does not have enough processors to run all the programs you want to run, it starts to give each program just a tiny slice of time on the processor it runs on. This is normally not noticeable but can lead to strange artefact...
In this challenge you'll be using be distributing a product over sums and differences of numbers, as explained here. Examples Input | Output -------------|------------- 23(12+42) | (23*12)+(23*42) 9(62-5) | (9*62)-(9*5) 4(17+8-14) | (4*17)+(4*8)-(4*14) 15(-5) | -(15*5) 2(3) | (2*3) 8...
Write a piece of JavaScript code that calls alert with an array containing the first 50 Fibonacci numbers in order. You may only use the following characters: +!()[]. As a reference, your code must be functionally equal to the following: var fib = [], a = 1, b = 1; for (var _ = 0; _ < 50; _++) { fib.push(a); va...
Consider a rectangular two-dimensional grid where each cell can either be empty (.) or full (0). e.g. ..00.... 0000.... .00000.. 000...00 ..000000 000.00.. The grid is considered infinite, all cells outside the depicted region are empty. The goal is to cover the filled spaces and leave the empty spaces open using a se...
Say I have text like this (each word on one line, with no spaces) Programming Puzzles & Code Golf That makes no sense! It totally defies the laws of physics. Your challenge is to remedy this impossible situation and collapse the text like so: P Prog &uzz Coderam Golflesming So that there is no empty space underneath ...
Write a term on the pure untyped lambda calculus that, when applied to a church-encoded list of numbers, returns it with its numbers sorted in ascending or descending order. Church lists and numbers must be encoded as folds for their usual ADTs: -- Usual ADTs for Lists and Nats (in Haskell, for example) data List a = C...
Introduction On BBC Radio 2, on Saturdays there's a show hosted by Tony Blackburn called Pick of the Pops. Here, Tony selects a random week from a random year (in the range 1960-1989), and plays the songs which were in the top 20 charts at the time. Challenge Given a list of songs played on one Pick of the Pops episode...
Write a program or function that given positive n and m calculates the number of valid distinct domino tilings you can fit in a n by m rectangle. This is sequence A099390 in the Online Encyclopedia of Integer Sequences. You may take input in as function argument(s), CLA or on stdin, in any reasonable format. You must r...
Background I have a bunch of square-shaped boxes of equal size, and since I'm a neat person, I want to arrange them all into a square formation. However, their number is not necessarily a perfect square, so I may have to approximate the square shape. I want you to find me the most aesthetically pleasing arrangement -- ...
There are quite a large number of prime generating functions. Pretty much all of them are constructed and are based on the sieve of Eratosthenes, the Möbius function or the Wilson's theorem and are generally infeasible to compute in practice. But there are also generators, that have a very easy structure and were found...
I define four box styles: +-----+ ooooooo ^^^^^ ******* | 1 | o 2 o < 3 > * 4 * | | o o < > * * +-----+ ooooooo vvvvv ******* Write a program or function that given an integer and a string will find one of the above boxes inside the string and change its style into the b...
Challenge Write a function which takes one parameter: an integer t. Your function has to stop your program for t seconds before continuing, similar to time.sleep(t) in Python and WAIT t in BBC BASIC. You must not use any built in waiting functions or any built in functions for executing code after a certain time, and y...
Accordion is a solitaire card game I recently came across where nearly every layout is solvable, but incredibly hard. You can play it here. Rules 52 face cards are placed face-up in a random order. Each turn, you replace a card with a later card, where the two cards: Share a suit or number and Are at a distance of 1...
Who doesn't love action movies with fast noisy cars, especially those with a lot of crashes? Who doesn't love action shots in ascii art? The scene is: Two cars are starting at opposite sides of a straight road (with 60 spaces between). They start driving towards each other at constant speeds. The car to the left drives...
Write a program or function that, given two ASCII strings A and B, will produce strings A' and B' where the common substrings are reversed in their place. The process for finding A' is as follows: A' is initially empty. If the first character of A is in B, find the longest prefix of A which is a substring of B. Remove...
Golunar/Unary is a way to encode all valid Brainfuck programs, but it is not an enumeration, since most natural numbers do not correspond to a valid program. For the purpose of this challenge, assume a doubly infinite tape and no comments, i.e., a Brainfuck program is valid if and only if it consists solely of the char...
MarioLANG is a two-dimensional programming language where the source code resembles a Super Mario Bros. level. Furthermore, its instruction set is very similar to Brainfuck's. This means that MarioLANG is essentially a 2-D Brainfuck where the instruction pointer moves like Mario. So when I wrote my MarioLANG submission...
Challenge Given a string as input, golf down the Fourier program which outputs that string. In Fourier there is no easy way to output a string: you have to go through each character code and output that as a character. Fourier The language is based upon an accumulator, a global variable which is initialised to 0 at the...
Who will rule the realm? You are given a family tree which contains: name, sex, date of birth, date of death and a list of heirs, for each family member. You may use any convenient (nested) list format to represent the tree. The following examples will use JSON. Determine who will rule the realm and in which order. The...
Consider a prime number p, written in base 10. The memory of p is defined as the number of distinct primes strictly less than p that are contained as substrings of p. Challenge Given a non-negative integer n as input, find the smallest prime p such that p has memory n. That is, find the smallest prime with exactly n di...
So... uh... this is a bit embarrassing. But we don't have a plain "Hello, World!" challenge yet (despite having 35 variants tagged with hello-world, and counting). While this is not the most interesting code golf in the common languages, finding the shortest solution in certain esolangs can be a serious challenge. For ...
Programming Puzzles & Code Golf is about to get a new moderator, Dennis! This challenge is a tribute to him and our other active (or recently active) moderators: Doorknob, Martin Büttner, and Chris Jester-Young. The challenge title is meant to be read to the tune of the Pepto Bismol song. Basically, we're going to trea...
Write a program (or function) that takes in a non-empty string of any printable ASCII characters. Print (or return) a zigzagging chain of the characters in the string with every neighboring pair of characters linked by: / if the first character occurs before the second character in normal ASCII order. e.g. B / A \...
Suppose you are given a pointer to the head of a singly linked list. Normally each node in the list has a pointer to the next element, and the last node's pointer is Null. Unfortunately the list might have been corrupted so that some node's pointer leads back to an earlier node in the list. How can I design an algorith...
Duplicate? I knew somebody must've done this before. Programming a programming language in itself is something that has interested me since I knew what a programming language was. So I thought I'd create a Code Golf challenge for you. Challenge Create an interpreter for a given programming language, programmed entirel...