# All Questions

927 views

### Knight on the Rim is Grim

Introduction Aron Nimzowitsch was a leading chess master and a influential chess writer. In his book 'My System', the first chapter deals about the importance of the center and why you should ...
516 views

### Fred's water bill

Fred is a quasi-friendly guy, but in reality he is mean. Because of this, Fred lives alone in a small apartment in Los Altos, CA. Fred is so mean because he is very particular about water. He, ...
131 views

### Autonest an array

Everybody loves nested lists! However, sometimes it's hard to make a nested list. You have to decide if you want to nest it deeper, or if you need to nest it shallower. So for your challenge, you must ...
54 views

### Decompose the domain

In scientific computing, it is often desirable to decompose some large domain into smaller "subdomains", then parallelize the computation by performing the work on each subdomain in parallel and the ...
45 views

### Can the famous multistage graph algorithm for shortest distance be solved in Order of no. of stages? [on hold]

For those who are not sure what multistage graph is: https://www.quora.com/Why-do-we-use-multistage-graph-problems-1 Please share your algorithm if you can solve it in order of no. of stages.
137 views

### Monitorize an Image [on hold]

The Problem: This challenge comes from a real problem I was having. I have a dual monitor setup at work, and I wanted to use the following image as my wallpaper: However, my monitors have quite ...
1k views

### Visualise Bit Weaving

The esoteric programming language evil has an interesting operation on byte values which it calls "weaving". It is essentially a permutation of the eight bits of the byte (it doesn't matter which end ...
3k views

### Theoretically output Graham's number

Graham's number G is defined in this way: u(3,n,1) = 3^n u(3,1,m) = 3 u(3,n,m) = u(3,u(3,n-1,m),m-1) [Knuth's up-arrow notation] [Conway chained arrow notation] THEN g1 = u(3,3,4) g2 = u(3,3,g1) g3 ...
2k views

### Professor Schwartzman's Acme Canine Decoder 2000

Introduction We -- especially the geeks among us, who tend to be fans -- all remember this old Far Side cartoon: Clearly, Professor Schwartzman could have brushed up on his programming skills just ...
252 views

### Evaluate a Stratego Battle

In the game Stratego, the main game mechanic is when you attack an opponent's piece with yours. In this challenge, you job is to simulate one of these battles and say who survives. Specs You will ...
3k views

### bfcat - encode a file as a brainf*** program

Challenge Write a program or function that given a string, returns a valid Brainfuck program that when compiled and executed as Brainfuck, returns that string.. (0) Assume all inputs are encoded as ...
265 views

### Ninja Assassins - which ninja stays alive? [duplicate]

Ninja Assassins - which ninja stays alive some basic information given an int N as the number of ninjas, return the number of the winning ninja. At the end only 1 ninja survives,the question is ...
2k views

### Simplify a square root

Given a positive integer n, simplify the square root √n into the form a√b by extracting all square factors. The outputted a,b should be positive integers with n = a^2 * b with b as small as possible. ...
190 views

### Build a marginal tax calculator

There have been some tax rate calculator problems here that depend on defined rates (specifically US federal rates), but none that have done it for arbitrary lists. Your task is to build a program or ...
208 views

### Flood-fill a 2D grid

Challenge description Let's call a two-dimentional, rectangular array (meaning its every subarray has the same length), a grid. Every unit of a grid is either an empty space or a border. In a grid of ...
1k views

### Falling ASCII balls

Input You are given a 2D map with balls and ground in it. It looks like this: 1 5 2 3 4 __________________________ Each number is a ball, and the _ is ...
163 views

### Solve the chromatic puzzle

Over at our friends at [Puzzling.SE], the following puzzle was posted: Is this chromatic puzzle always solvable? by Edgar G. You can play it here. Puzzle explanation Given a m x n grid with tiles of ...
265 views

### Time for some TEA!

Introduction A while back I stumbled across the tiny encryption algorithm (TEA) and since then I have recommended it whenever special cryptographic security properties were un-needed and a self-...
69 views

### Golf a Recursion [on hold]

Your goal is to make a function, which calls itself. It must be sure that it's recursion, so the function must print something or input. Rules The function (or how it's called in your favorite ...
83 views

### Coma programming [on hold]

Coma programming (the name is a pun on "comma") is a programming style where you cannot use any statements, other than return (implicit or explicit). Instead, you're encouraged to use any of the ...
2k views

### I only pay with dollars

As the title -- although discretely -- hints, I only pay with dollars. The challenge Write a function/program that takes a string as input, which is a monetary value preceded by a symbol. ex) £4.99....
54 views

### Convert Decimal to hexadecimal using inbuilt tools [duplicate]

There are no rules. You can use whatever language you want. I just want to know if there is any solution possible less than 10 characters. But all the solutions are welcome. RUBY 10 characters p ...
218 views

### Index sum and strip my matrix

Index sum and strip my matrix Given a matrix/2d array in your preferable language Input: The matrix will always have an odd length The matrix will always be perfectly square The matrix values can ...
915 views

### Forecast Palindromic Dates

Palindromic dates are dates that appear as palindromes: the string of digits can be read the same way backwards as forwards. For the North American date format (MM/DD/YYYY), the next few palindromic ...
2k views

### Bytes/Character

Task Given a UTF-8 string (by any means) answer (by any means) an equivalent list where every element is the number of bytes used to encode the corresponding input character. Examples ! → 1 Ciao → ...
706 views

### Character Counting System [duplicate]

GOAL : To Implement a character counting program This is how this counting system works : input of the program is a set of printable ASCII characters . the program counts each type of character , ...
710 views

### Play scrabble with the periodic table

You've got a set of tiles with the symbols from the periodic table. Each symbol appears once. You're thinking up words to make but you want to know if it's possible or not. The Challenge Write a ...
4k views

### Convert YYYYMM to MMMYY

Basing on this SO question. Challenge is rather simple: given a date period in the format YYYYMM output it in the format MMMYY. Rules: The input will be a number or a string exactly 6 characters ...
487 views

### Find the Cheese

Update: There are 6 mazes. They are included in the controller. There is a tar.gz of the mazes and their .bmp files here (dropbox). There is also a utility for making more mazes at that link (the ...
373 views

### Write a chicken interpreter!

You have to write an interpreter for a cool language called Chicken! You should read a Chicken program from a file, standard input, program or function arguments, or whatever is most convenient for ...
7k views

### Rube Goldberg Hello World

For this golf, you will need to use more than one language. The task A Rube Goldberg machine is a contraption that takes an enormous number of complicated steps in order to execute a very simple ...
2k views

### Calculate Euler's totient function

Background Euler's totient function φ(n) is defined as the number of whole numbers less than or equal to n that are relatively prime to n, that is, the number of possible values of x in 0 < x <=...
317 views

### Derivative at the Edge

My preferred way to approximate a derivative is the central difference, its more accurate than forward difference or backward difference, and I'm too lazy to go higher-order. But the central ...
258 views

### Ways to get to the number

Given the input of the first number and the second number (both positive integers, zero exluded), determine in how many ways could you make the second out of the first, using following actions: +1,+2 ...
123 views

### Tell Me about yourself [closed]

Your task is to write a self referential program similar to a quine. The objective is to write a program that will generally print to stdout twice whatever the input is. But when it receives the input ...
299 views

### Prove that a Number is Algebraic

Inspired by this answer (emphasis mine): We will play a game. Suppose you have some number x. You start with x and then you can add, subtract, multiply, or divide by any integer, except zero. You ...
389 views

### Chessboard maze

Chess pieces (kings, queens, rooks, bishops, and knights) and pawns are on a board, but not on the a1 or h8 square. Your task is to travel from the empty a1 to the empty h8 squares, passing through ...
385 views

### Downward Number Race

Your task is to create a program that adds random numbers to previous sums in the ultimate number racing showdown. Each racer (column) starts at 0 and adds either 1 or 0 to the previous sum at each ...
643 views

### Alternating sign matrix verification

An alternating sign matrix is an n by n matrix consisting of the numbers -1, 0, 1, such that: The sum of each row and column is 1 The nonzero entries in each row and column alternate in sign These ...
2k views

### Count Up, Replace, Repeat!

Definition Define the nth array of the CURR sequence as follows. Begin with the singleton array A = [n]. For each integer k in A, replace the entry k with k natural numbers, counting up from 1 to k....
220 views

### Count, Replace, Add Up! [duplicate]

Definition Define the nth term of the CRAU sequence as follows. Begin with the singleton array A = [n]. Do the following n times: For each integer k in A, replace the entry k with k natural ...
4k views

### Write a program to elasticize strings

Nice verb there, in the title. Write a program that given an input string, will "elasticize" this string and output the result. Elasticizing a string is done as follows: The first character is shown ...
976 views

### Bit-Reversal Permutations

Your goal is to create a function or a program to reverse the bits in a range of integers given an integer n. In other words, you want to find the bit-reversal permutation of a range of 2n items, zero-...
459 views

### Decode a Microsoft MS-DOS 5.0 FAT directory entry

The Microsoft FAT file system has a directory table to represent which "files" are in which "folders" on the disk. For the time, these entries crammed a lot of information into a small amount of bits. ...
2k views

### Difference of the square of the sum

Find the difference between the square of the sums and sum of the squares. This is the mathematical representation: (∑n)^2-∑n^2 Your program/method should take two inputs, these are your lower ...
216 views

### Convert the first letter of each word to uppercase, and the rest to lowercase [closed]

Description Your task is to take a string as input, and convert the first letter of each word to uppercase, and the rest to lowercase. Test Cases Input => Output ISN'T THIS A REALLY COOL TEST CASE?...
281 views

### Here's Bub. A not-so-world-class soccer player

This is Bub. Bub is a soccer player. However, he's not a very good one. He still can't kick the ball to the net! (If you haven't noticed, @ is the ball. ...
1k views

### “Add one” to every color in an image

You would simply take this image and make every color added one to every hexadecimal digit. For example, #49de5f would become #5aef60 (with the 9 looping to an a, and the f looping to a 0.) This ...