instruction
stringlengths
34
53.1k
Create the shortest program that given an input string it outputs the opposite-cased string. For example if I pass the string "HeLlO" the program should output "hElLo". Of course, neither aggregate functions can be used, nor framework functions like toupper() or tolower(). Any language is welcome.
This is my first code golf so please let me know if it's too broad or if I'm missing any information for a good puzzle! Challenge In Ontario and possibly other areas of the world, electricity is billed using Time-Of-Use (TOU) pricing, which varies the cost per kilowatt-hour according to when you use power. Given a date...
You are given a nonary (base 9) non-negative integer consisting of the digits 0 through 8 as usual. However the number of digits in this number (with no leading zeros) is a prefect square. Because of this, the number can be arranged in a square grid (with the reading order still preserved). Example with 1480 (1125 base...
This is one of several challenges left for the community by Calvin's Hobbies. Take a "family tree describing" file with lines of the form: [ID] [mother ID] [father ID] [gender] [full name] such as this which describes the first family tree at http://en.wikipedia.org/wiki/Cousin: 1 ? ? M Adam 2 ? ? F Agatha 3 ? ? M Bil...
A Euler Brick is a cuboid where the length of all the edges are integers and all of the diagonals of the faces are integers as well. All sides must also be different. Your program has to find as many different Euler Bricks where the sides are less than L within the time M (L and M will be defined later). All of your c...
Despite your protest, you have been put to work by your boss on a program that takes a single unsigned integer as input and prints the string "prime" if that integer is prime and "not prime" if it isn't. You may choose which language you do this in, as long as the resulting program is short; your boss very much appreci...
An ***ameoba graph**** is a type of tree whose nodes all have values from 0 to some non-negative integer N, and any particular node with value x < N connects to x+1 distinct nodes with values x+1. Ameoba graph for N = 3: (Denoted A3) Note that the 2's are not allowed to share any of the 3's; exactly three 3's must "be...
Each cell in a life-like cellular automaton only needs one bit to represent it since it can only be alive or dead. That means there are only two colors; pretty boring. Normal images have 24 bits per pixel (8 in each of R G B). This means in a normal image with pixels as cells you could simulate 24 life-like games at on...
Given a number N, output/return X so that N+X is a palindrome, where |X| has to be as small as possible. Palindrome: A number is a palindrome, if its sequence of digits is the same when reading them from left to right as when reading from right to left. 95359 and 6548456 are symmetric, 123 and 2424 are not. Numbers wit...
Objective Given a list of three-word passphrases, crack them all. Each time you guess, you will be given a clue in the style of Mastermind, depicting how many characters match the password, and how many are in their correct position. The objective is to minimize the total number of guesses over all test cases. Passphr...
Write a named function or program that computes the quaternion product of two quaternions. Use as few bytes as possible. Quaternions Quaternions are an extension of the real numbers that further extends the complex numbers. Rather than a single imaginary unit i, quaternions use three imaginary units i,j,k that satisfy ...
After the last Ludum Dare (LD) game programming contest a friend of mine made a nice mosaic of all the LD game thumbnails: After searching for my own game I quickly gave up and decided to solve it like a real programmer... by writing code that finds my game thumbnail. This is the thumbnail of my game: More examples c...
This question is from a programming challenge (not DARPA) which has ended. A sheet of paper consists of message, which has been shredded into vertical strips. Given the vertical strips and a dictionary of valid words, the goal is to put together the original message. The vertical strips contain only one character from...
Introduction You're an American spy during the heat of the Cold War and you've managed to intercept a Russian message. Immediately you recognise it as a code stick cipher and wrap it around a pencil. Looking at the paper on the pencil, you don't see anything. Then you try a bigger pencil, and you see it. Challenge You ...
Code Bots I hate private and protected variables. I just want to access anything and everything! If you are like me, then this challenge is for you! Write a bot that works together in harmony with other bots makes other bots do what you want. You are a programmer, and you know how things are supposed to work. Your j...
BrainFlow What is BrainFlow? BrainFlow is an extension of BrainF**k (BFk) with 3 additional commands for added functionality and confusion. What commands? In addition to the normal BFk commands, we also have: ^ Jumps to the cell # depending on the value in the cell. Ex: If we are at cell # 0 with a value of 4, ^ wil...
Because we can't get enough of esoteric language golfs, can we? ///—pronounced slashes—is a fun little language based on the s/// regex-replacement function of Perl fame. It contains only two special characters, slash / and backslash \. You can find a full article on it at the esolangs wiki, but I will reproduce a desc...
Let's create a N×N grid of spaces and underscores that can be used to visually determine if a number is prime. (N may be any positive integer.) This grid has three simple rules: The nth column contains the repeated pattern of n - 1 underscores followed by one space. This pattern starts at the first row and is stopped,...
The challenge is to find the maximum number you can get from a list of integer using basic arithmetic operators (addition, substraction, multiplication, unary negation) Input A list of integers Output The maximum result using every integer in the intput. The input order doesn't matter, result should be the same. You do...
Challenge A Pixel World is a PNG image where gravitational, electromagnetic, and nuclear forces no longer exist. Special forces known as "pixel forces" are all that remain. We define this force as Fp->q = a * (p * q) / (r * r) * r̂ F is the pixel force that p exerts on q a is Adams' constant, defined as a = 4.2 * ...
Terminals are so boring these days. They used to look like this: Now they're just bland and dull and black-and-white. I want you to write me a program that will make my terminal all colorful again! Description Take this example Ruby code: Most Linux terminals support these escape sequences (\e stands for the escape ...
The Challenge Implement a function which accepts two integers whose values range from 0 - 255 and returns the sum of those integers mod 256. You may only use bitwise negation (~), bitwise or (|), bit shifting operators (>>,<<), and assignment (=). Things you cannot use include (but are not limited to) Addition, subtra...
i've been dabbling with a hypothetical language... now, i want to add a feature/mechanism that can easily format data in as few codes as possible. now, i need to compare my hypothetical language feature with how it's going to be written in other languages. in particular, would it have lesser code? so i just decided i w...
Our classic snake has developed an inbalance of growth hormones. To make matters worse, his tail is frozen in place! Given directional input as specified in Figure 1, write a program to determine where he will grow. Figure 1. Directional input. Program specifications Read the input character by character on STDIN. Af...
This is a short one: Only once in American history has there been a decade in which four of the years were prime numbers. Your program has to output the decade after 1776 where four its years were primes. This is code golf so the shortest code wins. The output must be like so: 1710s or 1980s Note: The answer must b...
Winner: Chilemagic, a massive 21 bytes! You may continue to submit your answer, however you can no longer win. Original post kept: Your goal is to find all numbers in a string, and multiply each one individually by a value input by the user You will not need to worry about decimals The user will input a number and a ...
The Challenge I present to you another spy vs. spy challenge pitting obfuscators versus crackers. In this case, however, the datum to be protected is not an input but an output. The rules of the challenge are simple. Write a routine with the following specifications: The routine may be written in any language but may ...
Objective I have a nice picture that I want to hang on my wall. And I want it to hang there in a spectacular way, so I chose to hang it on n nails where n is any positive integer. But I'm also indecisive, so if I change my mind, I don't want a lot of trouble taking the picture down. Therefore, removing any one of the n...
Task Implement a program in minimum bytes of source or binary code that does voice recognition of a voice sample (me saying "yes", "yeah" or "no" in voice or in whisper, plainly or quirkily) based on training samples with maximum accuracy. The program should read train/yes0.wav, train/no0.wav, train/yes1.wav and so on ...
Your task is to devise a programme that extracts the bits, in order, represented by the first argument based on the set bits represented by the second argument (the mask). Formal Definition: Let the first argument x represent the binary string S=(xn)(xn-1)...(x1) with n>=0 and x1 being the least significant digit and...
There's a 500 rep unofficial bounty for beating the current best answer. Goal Your goal is to multiply two numbers using only a very limited set of arithmetic operations and variable assignment. Addition x,y -> x+y Reciprocal x -> 1/x (not division x,y -> x/y) Negation x -> -x (not subtraction x,y -> x-y, though y...
Here's one for all you wordsmiths out there! Write a program or function which takes a list of words and produces a list of all possible concatenative decompositions for each word. For example: (Note: This is only a small sampling for illustrative purposes. Actual output is far more voluminous.) afterglow = after + glo...
The goal of a Rosetta Stone Challenge is to write solutions in as many languages as possible. Show off your programming multilingualism! The Challenge When people use the term "average," they generally mean the arithmetic mean, which is the sum of the numbers divided by the number of numbers. There are, however, many ...
A centered polygonal number is able to be put into an arrangement of multiple concentric polygons, each with a side length of one more than the inner one. For example (image from linked page), the above image has 31 dots, so 31 is a centered pentagonal number. Write a program which receives a number as input (any typi...
My coworker and I work on a legacy piece of software that we hate sometimes. Whenever you run it, debug asserts come flying everywhere, and it's never a guarantee that anything will work. The motivation for this round of code golf came from my coworker saying the following about our software. "It's like every time you ...
Some background Counting rods are small bars (3-14 cm long) that were used by mathematicians from many asian cultures for more than 2000 years to represent any whole number or fraction. (In this chqllenge we'l focus on unsigned integers though) There was also a written version, called rod numerals. Here's how it works:...
This is a chess-KOTH with simplified rules (because chess itself is already complicated, playing it via a simple program doesn't make it easier). At the moment it is limited to java (version 8), but creating a wrapper-class isn't that difficult (in case someone wants to do this). Chessboard The chessboard in the contro...
There are 88 keys on a standard piano and 95 printable ascii characters (hex codes 20 through 7E): !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ('character' refers to any printable-ASCII character from here on) In this JSFiddle I've taken advantage of that and made a ...
Winners (decided 14/09/14) Winning answer by Markuz (Python) - 63 votes Runner up by kuroi neko (PHP) - 55 votes Introduction You are in the world of the book Nineteen Eighty-Four by George Orwell. You are a programmer for the Party and are tasked with writing a program for the telescreens. It should output pro-party m...
This is an optimization/algorithms challenge. Given two sets of points X and Y, which are to be thought of as points on a circle of circumference T, the challenge is to find the rotation which minimizes the distance from the set X to the set Y. Here the distance is just the sum of the absolute distance from each point ...
The task is simply to see how much faster you can calculate n choose n/2 (for even n) than the builtin function in python. Of course for large n this is a rather large number so rather than output the whole number you should output the sum of the digits. For example, for n = 100000, the answer is 135702. For n=1000000...
I like Tetris a lot, but I'm not very good at it. Just once I'd like to see that spaceship take off in front of my own eyes! And since computers are oh-so great at everything, the only possible solution is to make a program to play it for me... except you're going to do that bit for me! Given a tetromino (shape made of...
Some positive integers can be shown to have a property called Chain divisibility. For a number to be chain-divisible by n, it must fulfil three requirements: Each digit divides the number formed by the n  digits that follow it. For example, the number 7143 is chain-divisible by 2 because 7 divides 14 and 1 divides 4...
A station model is a diagram for recording the weather at a certain place and time. Challenge You must write the shortest code possible to graphically output a simplified (explained later) station model. Ticks A tick is a line on the wind barb. A 50 knot tick is a triangle. A 10 knot tick is a line. A 5 knot tick is ...
Welcome to Code Bots 2! You've learned your lesson since the last Code Bots. You've tried to figure out more ways to fit more actions in less lines, and now you finally have it. You're going to make an event-driven Code Bot. Your bot must consist of 24 lines. Each line follows one of the two formats: Condition:Actio...
If you are unfamiliar with hacker typer, see hackertyper.net. In short, it is a program that outputs one chunk of a code base per keystroke for comedic effect. BUT, the hackertyper.net version is far too easy to implement. It simply outputs three characters at a time from an arbitrary piece of code. For this challenge,...
The challenge is to draw the outline of an 'island', generated using a seed as input. Input (seed): string of 6 characters (exactly) allowing only lowercase letters (i.e. abcdefghijklmnopqrstuvwxyz) - examples: 'island', 'aaaaaa', 'jhgcfj' Each seed is to give a unique island (i.e. no two seeds will give the same outp...
Following on from the third order quine challenge, your task is to write an Ouroboros program that uses as many languages as possible. That is, in language A, write a program pA which outputs program pB in language B. Program pB should output program pC in language C, and so on until eventually a program outputs the or...
Your boss managed to read the secret hidden message. He didn't end up firing you, though, he just made you a secretary and forbade you from writing code. But you're a programmer. You need to write code. You must code. Therefore, your code needs to look as similar to English as possible, make sense, and look as little l...
A certain children's game, often called "Huckle Buckle Beanstalk", is played with two players. Here is a brief description of how the game is played: One player is designated the "hider", and the other the "seeker". The seeker goes out of the room while the hider hides a small, pre-selected object, the "treasure". T...
Write a program that takes in a rectangular block of text made up of X's and .'s, such as this rough A: ...... ..XX.. .X..X. .XXXX. .X..X. .X..X. Output a representation of this grid rotated 45 degrees counterclockwise by drawing a slash — forward or backward depending on context — everywhere an X borders a . or the s...
Okey, we all know the normal way to throw a IllegalArgumentException in Java: throw new IllegalArgumentException(); // 37 characters But there must be a shorter (as in less characters) ways to do so. How can we produce a java.lang.IllegalArgumentException with even less code? The code fragment has to compile and run ...
Prior to the discovery of fingerprints and DNA testing, the British police used an anthropometric system to identify repeat offenders. Certain parts of the bodies of criminals were measured and stored in records -- these parts of the body were assumed to not change in size after adulthood. This system was known as bert...
I have a program that generates formatted Brainfuck code. I run my program ./example "S" and the output is +[>+ < +++ ] >--. which prints S in Brainfuck. Your objective is to write a program which accepts a string as input and outputs source code in another language which prints that string. The source code yo...
Given an integer n (where n < 10001) as input, write a program that will output the first n Ulam numbers. An Ulam number is defined as follows: U1 = 1, U2 = 2. For n > 2, Un is the smallest integer which is greater than Un-1 that is the sum of two distinct earlier terms in exactly one way. For example, U3 is 3 (2+1...
Write the shortest program possible that takes in a set of distinct positive integers and outputs an ASCII rendering of concentric hexagons with those side lengths, made from slashes, underscores, spaces, and newlines. The shortest program in bytes as counted by https://mothereff.in/byte-counter wins. Examples (They lo...
Produce the shortest program which takes two signed integers as input (through stdin or as arguments) and displays 3 different outputs depending upon whether the first number is (1) greater than, (2) smaller than, or (3) equal to the second number. The Catch You cannot use any of the following in your program: The sta...
A polyquine is both quine and polyglot.1 You are to write a quine which is valid in at least two different languages. This is code golf, so the shortest answer (in bytes) wins. 1 I made that up. Or rather, Geobits did. Apparently, he wasn't the first one either, though. Rules for Quines Only true quines are accepted. T...
This is a simple one: create the shortest browser script to change every appearance of force on a web page into horse. This script needs to be able to be pasted into the console and work on most modern browsers. You must replace all occurences of the word force and conjugates of the word force (forcing, forced, reinfor...
Consider a square n by n grid graph that looks like this. It is important to notice that this graph is 11 by 11. At any given point a man stands at an intersection and he only ever moves vertically or horizontally by one step at a time to the next intersection. Sadly he has drunk a little too much so he chooses the d...
Yesterday, I bought a harmonica: Figure 1: The harmonica. However, my dreams of being able to play soulful blues harmonica that moves people and causes a grown man to cry were quickly dashed by two problems: The harmonica can only play certain notes; I am depressingly bad at playing the harmonica. Despite my lack of...
Most computers store integers in binary, but output them in decimal. However, decimal is just one representation, we just happen to find it convenient. This challenge is to write some code to output an integer value in shortlex decimal. What's that? http://en.wikipedia.org/wiki/Shortlex_order Shortlex takes the length ...
In Gödel, Escher, Bach, Douglas Hofstadter introduces an integer sequence which is commonly referred to as the figure-figure sequence: 2, 4, 5, 6, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, ... You may enjoy working out the definition of the sequence yourself as part of the challenge, but if you can...
Intro Let's play some mini-golf! The golf ball is represented by a . and the hole by a O. You want to get a hole in one on every hole, but you are not good at putting. In fact, you refuse to attempt putting diagonally! Only up, down, and to either side. You plan to cheat by placing extra bumpers \ and / so you can put ...
A 2D board will contain the following objects: ^,>,v, or <: A laser emitter facing up, right, down, or left respectively. There may be more than one. Lasers will travel in a straight line in empty space (empty space is represented with a dot .). Lasers do not pass through emitters. *: A target. Lasers pass through tar...
You are a young programming geek living with your 2 other best friends. Every week, one of you has to do all the chores of the house and you decide whose turn it is by picking a stick. The one who picks the shortest stick loses and does all the chores. As all of you are programmers and love creating puzzles, you have m...
Write a program or function that "reacts" to a given integer n (input via function parameter/args/stdin) The program doesn't care about negative numbers, likes even, dislikes odd numbers and fears the number 13. It should output the following: if n<0: -------------------------- | | | ...
This competition is over. The winner is CJam with 22 characters, beating TwiNight's answer by one character. Congratulations Dennis! An honorable mention goes to Falko, who went totally crazy with the free imports. . A while ago I wanted to know how I can out-type modern smartphones with my Nokia 3310, and while some ...
Inspired from the assortment of other 'Tips for golfing in language xyz'. As usual, please only suggest tips that are specific to OCaml and not programming in general. One tip per answer please.
This is one of several challenges left for the community by Calvin's Hobbies. The curve that an idealised hanging rope or chain makes is a catenary. Image by Bin im Garten, via Wikimedia Commons. Used under the CC-By-SA 3.0 licence. Write a program that will draw a catenary, as an image, in quadrant 1 of the plane g...
The edit (or Levenshtein) distance between two strings is the minimal number of single character insertions, deletions and substitutions needed to transform one string into the other. If the two strings have length n each, it is well known that this can be done in O(n^2) time by dynamic programming. The following Pytho...
This is similar to other "Tips for golfing in <...>" but specifically targeting the newer features in JavaScript brought up in ECMAScript 6 and above. JavaScript inherently is a very verbose language, function(){}, .forEach(), converting string to array, array-like object to array, etc, etc are super bloats and not hea...
Leaderboard User Language Score ========================================= Ell C++11 293,619,555 feersum C++11 100,993,667 Ell C++11 78,824,732 Geobits Java 27,817,255 Ell Python 27,797,402 Peter Taylor...
If you want to build a fence and have different length boards available, there are many different ways to set up your posts. So, given a minimum and maximum board length, a number of boards, and the total length, count how many ways you can arrange them. Input Input is four positive integers: min: The smallest board u...
Recamán's sequence (A005132) is a mathematical sequence, defined as such: A(0) = 0 A(n) = A(n-1) - n if A(n-1) - n > 0 and is new, else A(n) = A(n-1) + n A pretty LaTex version of the above (might be more readable): $$A(n) = \begin{cases}0 & \textrm{if } n = 0 \\ A(n-1) - n & \textrm{if } A(n-1) - n \textrm{ is positi...
What tips do you have for golfing in Applescript? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Applescript (e.g. "remove comments" is not an answer).
The ubiquitous 7-segment numerical display can unambiguously display all 16 hexadecimal digits as show in this wikipedia .gif Entries for this challenge will create a circuit diagram using NAND logic gates which transforms the four bits of a hex digit to the inputs for the seven segments. The inputs for the 7 segment ...
What are some clever (brief and idiomatic) approaches to taking a list of strings and returning a single properly punctuated string built from the list, with each element quoted. This came up for me while experimenting with Groovy, for which my too-literal, but illustrative solution is def temp = things.collect({"\'${i...
Electron Configurations Your mission is to accept an element's atomic number as input, and output its electron configuration (e.g. 2,8,8,2 for calcium). Input An atomic number from 1 to 118. You may assume valid input. The atom is not charged (it has as many electrons as protons). You may not expect the input to be sto...
Pigpen Cipher Encryption Your mission is simple: to write a program which receives text as input and outputs an ASCII representation of it in the Pigpen Cipher. Input ASCII-only (no Unicode) characters. You must be able to handle at least 16384 characters and 256 lines. Output Replace all characters which are not new ...
Clem is a minimal stack-based programming language featuring first-class functions. Your objective is to write an interpreter for the Clem language. It should properly execute all examples included in the reference implementation, which is available here. As usual, standard loopholes apply. Smallest entry by byte coun...
This is an easy one. Anagrams are words which have the same characters but in different order. All you have to do is to figure out if two strings are anagram or not. Rules: Take two strings as a function argument, command-line argument or from standard input. Write a function or program which returns truthy value if s...
Penalty shootout Welcome to CG world cup. Your job: Code a penalty shooter and goal keeper! Rules of the game: The goal is 700 cm wide and 200 cm tall. If I have to make a rectangle out of it, the goal is ABCD where A is (0,0), B is (0,200), C is (700,200), D is (700,0). The shooter gives me the coordinate where he wi...
(Continuing on the number sequences code-golf, here is an interesting sequence) Eban Numbers (A006933) are the sequence of numbers whose names (in English) do not contain the letter "e" (i.e., "e" is "banned") The first few numbers in the sequence are: 2, 4, 6, 30, 32, 34, 36, 40, 42, 44, 46, 50, 52, 54, 56 Given an i...
Surprisingly, we haven't had any challenges on graph colouring yet! Given an undirected graph, we can give each vertex a colour such that no two adjacent vertices share the same colour. The smallest number χ of distinct colours necessary to achieve this is called the chromatic number of the graph. For example, the foll...
Curve stitching is the process of "stitching" together multiple straight lines in order to create a curve, like so: For an explanation of curve stitching, visit this website. We will be drawing our curve in the top left of the screen, as shown in the image above. Given an integer n (via STDIN or a function parameter),...
Detect Duplicate Questions Once upon a time, there was a golfing site. It had a problem: people would post similar or identical questions again and again. You have been chosen selected forced conscripted blackmailed requested to automate the process of deciding whether a question is a duplicate of an existing one, by w...
Lets say I was writing something, and I accidentally wrote it in the wrong box: +-------+--------+ | Verbs | Nouns | +-------+--------+ | Truck | | | eat | Banana | | | Car | +-------+--------+ So I, being lazy, merely draw an arrow to the space it should be: +-------+--------+ | Verbs | Nouns | +-...
A radioactive quine is a quine-like program that has an even number of characters and, when run, outputs itself with exactly half of its characters removed. The output itself may be a radioactive quine, so the program can "decay" multiple times. It could be said that the half-life of a radioactive quine is one run, up ...
Problem Imagine 7 buckets lined up in a row. Each bucket can contain at most 2 apples. There are 13 apples labeled 1 through 13. They are distributed among the 7 buckets. For example, {5,4}, {8,10}, {2,9}, {13,3}, {11,7}, {6,0}, {12,1} Where 0 represents the empty space. The order in which the apples appear within eac...
Introduction I can't stand text abbreviations, mainly because for the most part I have no idea what most of them mean. Of course, cut backs need to be made, so if they are necessary to fit the text in the character limit, I'll allow them. Challenge You have to write a program that takes passage of text and determines w...
Given a standard combination lock like the one in the picture. The way to unlock it is to align the 4 numbers in the code on the combination line. After years of loyal service you have been fired from the lock factory and have decided to exact revenge by not jumbling up the locks before you send them off, thus leaving ...
Reducing fractions the wrong way In this code-golf challenge you have to find fractions that can be reduced the wrong way but still end up in the same number. Note: reducing fractions the wrong way does here have an exact definition, see details. Example: 64/16 = 64/16=4/1 = 4 Of course you cannot just strike both 6es ...
Introduction Let's start by arranging all fractions from 0 to 1 in order of lowest denominator, then lowest numerator: 1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 5/6, 1/7... Note that duplicates aren't counted, so I haven't listed 2/4, 2/6, 3/6, or 4/6, since they already appeared in their simplified forms (1/2,...
There's a simple digital number lock. After each button press the lock checks if the previous four presses constitute the correct code. I.e. typing 44445 tests two codes: 4444 and 4445. You must brute force it with a code golfed program. Rules Your program must test numbers by printing ASCII digits 0-9 to standard out...
When I see code-golf entries that knock a few characters off, whittling down the code, I go look at the edit history for a side-by-side diff. See and learn :) This challenge is to make a program that produces the prettiest animated diffs. The input will be any ordered series of text versions. The program may be writt...
The Challenge: Make the shortest program to confirm that 12 is the answer. (The puzzle is from Ian Stewart's "Cabinet of Mathematical Curiosities". This is my first code golf question. I hope this type of thing is allowed) In Scrabble the following are the letter scores: AEIOULNRST score 1 each DG score 2 eac...
UPDATE : isaacg's Pyth submission is the winner! Many of you must have heard that there is a cooler version of JavaScript in town (read ES6) which has a method String.prototype.repeat so that you can do "Hello, World!".repeat(3) and get "Hello, World!Hello, World!Hello, World!" as the output. Your job is to write a ...
Programmer's Garden Being a professional software developer, you cannot risk exposing yourself to the harsh non-artificial light of the sun, but you also have a soft spot for flowers, and want to keep your garden in good shape all year round. To this end, a gardener is hired each month to tidy up the flowerbed at the f...
Background Most people on here should be familiar with a few integer base systems: decimal, binary, hexadecimal, octal. E.g. in the hexadecimal system, a number \$abc.de_{16}\$ would represent $$a\times16^2 + b\times16^1 + c\times16^0 + d\times16^{-1} + e\times16^{-2}$$ However, one can also use non-integer bases, like...