instruction
stringlengths
34
53.1k
The challenge Write a function that takes two positive integers \$n\$ and \$k\$ as arguments and returns the number of the last person remaining out of \$n\$ after counting out each \$k\$-th person. This is a code-golf challenge, so the shortest code wins. The problem \$n\$ people (numbered from \$1\$ to \$n\$) are sta...
Yesterday, I stumbled on a very clever thing. Yes, that's a working implementation of Tic-Tac-Toe on a user profile page, from @minitech. Of course, the moment I saw it, I had to reverse engineer his idea and one-up him :P Here's my own example embedded directly in the post. It's a tad buggy due to a couple of impl...
A similar play on the boggle problem from before (some text from that has been used below, edited to fit) any code that solves the familiar "text-twist" game Objective 7 letters are given at random, to which there is a minimum 1 word that uses all 7 letters, and multiple words using less (3 or more required) The letter...
Problem There is a circular track containing fuel pits at irregular intervals. The total amount of fuel available from all the pits together is just sufficient to travel round the track and finish where you started. Given the the circuit perimeter, list of each fuel pit location and the amount of fuel they contain, fin...
This is my first code golf question, and a very simple one at that, so I apologise in advance if I may have broken any community guidelines. The task is to print out, in ascending order, all of the prime numbers less than a million. The output format should be one number per line of output. The aim, as with most code g...
Background Mu Torere is a game that is one of only two known to be played by the Maori people of New Zealand before European influence. This makes it a very unique game in that it has an "objective winning criterion" and rules of play that are different from most other games in existence. Gameplay: The board is an oc...
Overview The ancient Romans devised a number system using Latin letters, which served them well, and which is still used by modern civilization, though to a much smaller degree. In the time of its use, Romans would have had to learn to use and manipulate these numbers in order to be of much use for many applications. F...
Given a list with lists nested inside it, return the list with the nested lists' items de-nested. Input The list will have, at most, 4-deep nested lists. Count all 0's within the input as a null space. Output Individually print out each item. Do not print out the output as a list. You can seperate each item with any k...
The challenge is to remove vowels (a, e, i, o, u) from string from STDIN (yes, I know, simple). You can expect that your program will be not ran with any arguments in argv. Example: This program will remove VOWELS. So we can now speak without them. Is changed to: Ths prgrm wll rmv VWLS. S w cn nw spk wtht thm. There ...
Write the shortest program that prints the entire lyrics of "Never Gonna Give You Up" by Rick Astley. Rules: Must output the lyrics exactly as they appear in the above pastebin*. Here's the raw dump: http://pastebin.com/raw/wwvdjvEj Cannot rely on any external resources - all lyrics must be generated by / embedded in ...
Your challenge is to write a routine, in x86 assembly, which takes a buffer containing 32-bit signed integers and writes a sorted list of the prime values to another buffer, then returns the number of values written to the output buffer. The winning solution is the one that uses the least instructions. Here's a pseudo-...
Overview Adding slightly to the complexity of working with Roman numerals... The ancient Romans devised a number system using Latin letters, which served them well, and which is still used by modern civilization, though to a much smaller degree. In the time of its use, Romans would have had to learn to use and manipula...
Your challenge (if you choose to accept it) is to implement big integer multiplication in the shortest code possible. Rules: Take two integers (decimal form) as ASCII strings from the command line parameters of your program. If your language doesn't support command line parameters, I'll accept stdin or similar input m...
Potentially very difficult, but I've seen some amazing things come out of this site. The goal is to write a program, in any language, that does whatever you want. The catch is that the program must be valid after any circular shift of the characters. A circular character shift is very similar to a Circular Shift. Some ...
As you may know, hackers are everywhere and they want to hack everything. You were asked to make password requirements which will stop any hacker. The problem is, that your boss has heard that paying for LOC is evil and he pays you $1800 - $0.03 * characters inserted per month to make you write simplest thing which pos...
Overview: From Wikipedia: An Egyptian fraction is the sum of distinct unit fractions. That is, each fraction in the expression has a numerator equal to 1 and a denominator that is a positive integer, and all the denominators differ from each other. The value of an expression of this type is a positive rational number a...
An arithmetic sequence is a sequence of numbers of the form a,a+n,a+2n,a+3n, etc. In this case, a and n will both be either integers or decimals. Given two inputs, a, n, and a top number value, return a list of numbers where the last term is less than or equal to the top number value. The input can be formatted in any ...
Create a program that computes the hamming weight of a string. Winner is the program with the lowest hamming weight. Rules: Hamming weight for an ASCII character is defined as the total number of bits set to 1 in its binary representation. Assume input encoding is 7-bit ASCII, passed through whatever input mechanism i...
Write some code that causes a BSOD or kernel panic! Rules: On Windows, you must cause a BugCheck (Blue Screen of Death), on Linux (or other *nix systems) you must cause a kernel panic. Must not damage the system (i.e. it should work on reboot) Kernel-mode drivers are allowed. State your OS and version information. Exp...
Your task is to golf a program that prints which character encoding, if any, the data read from the input represents. It should be able to detect the following encodings: ASCII ISO 8859-1 UTF-8 UTF-16 One of the above names of character encodings should be printed (in the same way) if it can be determined which is us...
Inspired by this question. Given a list containing numbers, print: The sum and product of the numbers in the list The average and median The differences between each term in the list (e.g. [1,2,3] -> [1,1]: 1+1=2, 2+1=3) The list, sorted ascending The minimum and maximum of the list The standard deviation of the list ...
Code golf always involves some answers that bend the rules more or less by breaking constraints that the challengers took for granted or just haven't thought about and didn't list in the rules. One of these interesting loopholes is the possibility to output more than the challenge asks for to get a better result. Takin...
The Sierpinsky Triangle is a fractal created by taking a triangle, decreasing the height and width by 1/2, creating 3 copies of the resulting triangle, and place them such each triangle touches the other two on a corner. This process is repeated over and over again with the resulting triangles to produce the Sierpinsk...
Back when I was a freshman in highschool taking chemistry, I'd look at the periodic table of elements and spell dirty words out with the number of the elements (HeCK would be 2619, 2-6-19). I was thinking about this the other day when I saw an amazing shirt that spelled out BeEr (4-68) So my codegolf challenge is short...
Input: A line of the standard slope-and-intercept form: mx+b, as well as a set of Cartesian points determining the vertices of a polygon. Assume that the x and y values of the points will be integers. Output: A boolean, which is true if the line enters or touches the polygon, and is false otherwise. This is a little tr...
A magic hexagon is a hexagon where every row and every diagonal add up to the same value. In this case the value is 38. Each number from 1 to 19 must be used exactly once. This image shows a solution but I want a program that derives this result. Your challenge is to solve the magic hexagon as fast as possible. You mu...
Rules are simple: First n primes (not primes below n), should be printed to standard output separated by newlines (primes should be generated within the code) primes cannot be generated by an inbuilt function or through a library, i.e. use of a inbuilt or library function such as, prime = get_nth_prime(n), is_a_prime(...
Came over a similar problem in a project I'm working on and found it quite hard to solve it without excesive use of if. I'm eager to see if anyone can come up with more elegant solutions to this, with the aribitary numbers I have given to the line segments. The problem You are given two integers that act like the end p...
Given two binary numbers (strings containing 0s and 1s), perform operations on them, with one problem: You must keep them in binary. That means no going binary(integer(n1)+integer(n2)) or anything like that. Input: Two binary numbers, n1 and n2, and a number between 0 and 3, o, defining the operator. The two binary num...
How could we generate shapes or images using binary? I got to messing around trying to create something that looked matrix like and got to thinking, wouldn't a great CodeGolf be to see who can make the best shortest code to generate a binary image? Please advise me of any rules I should add. Rules: Create a binary ima...
This is a slightly different code golf from the usual problems. I'm forced to work with Java at my workplace and I'm increasingly annoyed at what I must do to read a file into memory to a String so I can operate on it in a normal way. The golf is this: What is the shortest possible function to dump a file into your la...
Given a list of strings and a length, give all combinations of that list with the given length. The problem is: your code must not be recursive. Yes, it can be done. I have done it myself, when I had no clue what this "recursion" was. Input: A list of strings of an undefined length, and an integer defining the length o...
The challenge is to create an iterator(/generator) which iterates (in any order so as to reach all of them... ie no set should occur at infinity) over all possible non-empty finite sets(/tuples/lists) of positive integers (hence demonstrating their countability). Since the problem of verifying the correctness of a solu...
The continued fraction of a number \$n\$ is a fraction of the following form: $$a_0 + \cfrac 1 {a_1 + \cfrac 1 {a_2 + \cfrac 1 {a_3 + \cfrac 1 {a_4 + \ddots}}}}$$ which converges to \$n\$. The sequence \$a\$ in a continued fraction is typically written as: \$[a_0; a_1, a_2, a_3, ... a_n]\$. We will write ours in the sa...
This is based on a game one of my math teachers used to play in middle school. He would write 5 random one-digit numbers on the board, and then a random two-digit number. We would try to create an equation that used all 5 of the one-digit numbers to yield the two-digit number. Here are some examples with solutions to e...
A twist on a recently asked question, you are given a list of operators and a result and you need to find integers which, when operated on by those operators, generate the result. Example 1 input + + * / 13 possible output 4 8 2 2 4 which means that 4 + 8 + 2 * 2 / 4 = 13. More specifically, you are given a sequence ...
Write the shortest possible program (length measured in bytes) satisfying the following requirements: no input output is to stdout execution eventually terminates total number of output bytes exceeds Graham's number Assume that programs run until "normal" termination on an ideal computer1 able to access unlimited res...
The Pythagorean Theorem states that for a right triangle with sides a, b, and c, a2+b2=c2. A Pythagorean triplet is a set of three numbers, where a2+b2=c2, a To extend this even further, a primitive Pythagorean triplet is a Pythagorean triplet where gcd(a,b,c)=1. The goal is to find 100 primitive Pythagorean triplets. ...
Given an a-by-b sized grid, and a chess knight, determine: A starting point and path the knight can take to visit every square in the grid or "NOT POSSIBLE", if not possible. Input: Two integers, a, b. Output: Numbers output in an a-by-b grid: 1 4 7 10 8 11 2 5 3 6 9 12 Where 1 is where the knight starts, a*b is whe...
Sexy Primes are pairs of numbers \$(n, n+6)\$ such as \$n\$ and \$n+6\$ are both prime You need to create a function which will take an integer, check for sexy primes from 0 to that integer, and return an array of arrays. For example, listSexy(30) must return [[5,11], [7,13], [11,17], [13,19], [17,23], [23,29]] or some...
Minesweeper is a logic game found on most OS's. The goal of the game is to determine where the mines are on a grid, given numbers indicating the number of mines around that spot. Given a grid size, and a set of mines, generate the Minesweeper grid for that set of mines. Input: Two integers indicating the grid size, and...
The clustering coefficient of a graph (or network) is a: measure of degree to which nodes in a graph tend to cluster together The Wikipedia article gives a much better description of how network average clustering coefficient is calculated from local clustering coefficients than I could give. The Challenge Given an a...
Input: Input is a randomized array of nuts (in your language), the possible nuts follow. Your program must have a way of representing each kind of nut, such as an integer code. Program must be able to handle any size array of any configuration of nuts. Possible Nuts: Kola nut Macadamia Mamoncillo Maya nut Mongongo Oak ...
Project Euler Problem 387 states: A Harshad or Niven number is a number that is divisible by the sum of its digits. 201 is a Harshad number because it is divisible by 3 (the sum of its digits.) When we truncate the last digit from 201, we get 20, which is a Harshad number. When we truncate the last digit from...
Name the poker hand Given five cards, output the name of the poker hand, which will be one of: High card One pair Two pair Three of a kind Straight Flush Full house Four of a kind Straight flush Royal Flush If in doubt, refer to the rules at http://en.wikipedia.org/wiki/List_of_poker_hands. Input 5 cards from either s...
The problem is very simple: write a program that accepts a single unsigned integer from the command line, and prints out that many random numbers on the standard output, in ascending order. For example: input: 5 output (you can use any type of whitespace): 557 9424 19212 32293 39135 However, you are not allowed to de...
There is a mouse in a room, in the top-left corner. It can move up, down, left, or right, and the mouse cannot go through any cell in the room twice. Given this, return all the possible paths in which the mouse will visit every square. Input: Two integers m and n, which represent the m x n room. m<9, n<9. Output: The ...
It is often said, that all programmers should be able to write a "hello world" program in any programming language after a few glances on that language (And quicksort after a few more glances). As the Conway's Game of Life is Turing complete (so it qualifies as a general-purpose programming language), the problem is se...
A typing speed test loads up a dictionary of words, and gives you one to type: pinball. You, with your fast but inaccurate fingers, type in pinbnal. Darn it! Make a program that will print out a random word from a dictionary, then ask for the user to type this word back, and finally return whether or not they got the ...
Explanation A perfect shuffle is where a deck of cards is split exactly in half and the cards from each pile are alternately interleaved. The original bottom cards and the original top card must be preserved after a perfect shuffle. After 8 perfect shuffles, a standard 52 card deck returns to its original order. Challe...
Challenge Write the shortest program P such that P takes any positive integer n as input, and outputs a program string P1 executing P1 (with no input) outputs a program string P2, executing P2 (with no input) outputs a program string P3, ... executing Pn (with no input) outputs exactly "Hello!" (without the quotes)....
The challenge is to create one program that will accept as arguments (arrays of arrays) or on standard input (line-by-line, separated by commas) a collection of families and names, like so: John,Anna Mark,James Elizabeth,Daniel,Isabelle Ryan,Ruth As well as two other arguments (two more arrays of pairs, as arrays) or ...
A basket is full with \$n\$ colored balls. For each color except one, there are at least 2 balls with that color. Find the color which only has one ball. in \$O(n)\$ space complexity. What if each ball is repeated exactly twice? You can consider the input to be an array or a list or any container of colors as strings ...
GolfScript gets its own way far too often and I feel that a repository of handy hints for golfing in J might help in the fight against the evil empire. What tips do you have for making this already terse language shorter? For those wanting to learn J, the obvious place to begin is the jsoftware site and particularly th...
Here is some example input, so I can explain what the problem is: ((1 2)(3 (4 5) moo)) (i (lik(cherries)e (woohoo))) Think of this line of text as a topographic map of some mountains. Each set of parentheses illustrates one unit of altitude. If we "view" this from the side, so that we see the mountains vertically, we ...
The challenge is twofold: Make a program that builds a door. ASCII, HTML or otherwise Make the door functional. Opens and closes Either open-able through input or interaction! Non-functional door +5 points. Just a open-able door +10 points. Interactive door +15 points. Fancy door +20 points. This means revolving,bifol...
Please write a program that takes as input two numbers 'day of the month' and 'month number' for any day of this year (2012) and outputs day of the week. Examples: % ruby ./golf.rb 14 07 # 14th of July "Sat" % ruby ./golf.rb 14 7 # the same "Sat" % ruby ./golf.rb 01 12 # Dec 1 "Sat" % ruby ./golf.rb 31 12 # Last day ...
Triangle Puzzle Consider the triangle below. This triangle would be represented by the following input file.    5   9 6  4 6 8 0 7 1 5 By starting at the top and moving to adjacent numbers on the row below, one creates a path to the bottom of the triangle. There are many such paths in a triangle, which may have diffe...
If you like, write a program which sorts cities according to the rules of city name game. Each name of the city should start from the last letter in the previous city name. E.g. Lviv -> v -> Viden -> n -> Neapolis -> s -> Sidney -> y -> Yokogama -> a -> Amsterdam -> m -> Madrid -> d -> Denwer In the sorted list first ...
We all know how the discussion about which is the best operating system caused a lot of flame-wars. Your goal is now, to provide decisive "proof" that your favorite operating system is better... ah, no, much better, to provide decisive "proof" that another operating system is bad. The task: Write a program, that does s...
Are there any useful shortcuts that can be used in Java? As shown below, import already adds at least 17 characters to a program. import java.io.*; I understand that the simple solution would be to use another language, but it seems to be a real challenge to shorten Java programs. Tips should be specific to Java...
A Friedman number is a number that can be expressed by applying basic mathematical operations(^,/,*,+,-) to all it's digits. The operations need not be applied to each individual digit, but all the digits must be involved. That is, 121= 11^2 --> all digits are involved, but 1 & 1 have been clubbed together to make 11. ...
Generate an ASCII wilderness map. Example output: ................^^^^ ..................^^ ...^^^^........o.... .....^^^^........... .................... ........o....TT..... ..TTTT.............. TTTT.TTTT....~~~~~~. ..TT..........~~~~~~ .................... Anti-example (don't do this): .................... ...........
The goal is to write a program that learns from its own mistakes, and improves itself based on it. This means, that later attempts at the problem should be either faster or more accurate, than earlier ones. To deny trivial solutions, here is a set of rules (they are rather obvious): you can choose the problem to be s...
Scoring a Go game is a task that is not all too easy. In the past there have been several debates about how to design rules to cover all the strange corner cases that may occur. Luckily, in this task you don't have to do complicated stuff like life and death or seki detection. In this task, you have to implement a prog...
"Y.M.C.A." is a popular disco song by the Village People that has a well-known dance. Write the shortest program to output the capital letters "Y", "M", "C", and "A" synchronized to the song's chorus. Generally, one letter goes on each line sent to standard output. This primarily is to simplify programs subject to the ...
This is similar to other hang-man style problems already posted, except, in this case, the computer is the one guessing. Computers are logical, smart, and consider self-preservation to be important, so there are a few RULES for how computers will guess. The user will think of any word, that will be contained in the FUL...
I come across a question in a coding competion "write a code that returns SIGSEGV(Segmentation fault ) " . Points were given on the basis of length of code. The prgramming languages available were asm,c,c++,java . I knew c language better and submitted my code as main(){char *c="h";c[3]='j';} But others ...
Given a string, mark which parts in the string repeat in box brackets, and write how many times it does so before the box. Example:st st st Hello ThereThere st(with a space after) repeats 3 times, There repeats 2 times, and l repeats 2 times in Hello, so the output will be: 3[st ]He2[l]o 2[There] There is no space betw...
Write the shortest code, in number of bytes, to display, return, or evaluate to the golden ratio (that is, the positive root of the quadratic equation: \$x^2-x-1=0\$, approximately 1.618033988749895), to at least 15 significant figures. No input will be given to your program. Sample in Stutsk programming language: 1 10...
First save the following text into a file called marks.csv Smith,6,9,24 Jones,9,12,20 Fred,5,9,20 Each line contains a students name and three marks they scored. Find the top student by simply summing the three marks and then output their name. In this case the output is: Jones I would like to see somebody beat my Py...
Write a non-trivial regex that matches itself. For example, #.*$ will match a comment outside of a string in python until the end-of-line, and also matches itself in perl regex syntax. Rules: The regular expression must do something useful or practical. Tell what regex syntax you are using (e.g. perl or POSIX). Winner...
On a standard 88 key piano, each key has a scientific name. The first three keys are A0, B♭0, and B0. The keys then proceed through C1, D♭1, D1, E♭1, E1, F1, G♭1, G1, A♭1, A1, B♭1, B1, and start over again at C2. This continues up through B7, and the final key is C8. Any flat can instead be written as a sharp of the pr...
AKA: the most complex way to return a string I could think of. Requirements: *Edit: * @Griffin, You are correct, the goal is to use crossover/mutation of characters in a string to eventually come up with the same as input, although, "Hello World" was simply an example. Really, I just like to see what the others on the ...
Task Develop some code to generate a psuedo-random number between X and Y (taken as input). Explain why or how it works. Conditions Do not use any random generating seeds, pre-written randoms, or external source to generate the random number. Make something as close to random as you can get. No hard coding of values. ...
Quoting this question on SO (Spoiler alert!): This question has been asked in an Oracle interview. How would you divide a number by 3 without using *, /, +, -, %, operators? The number may be signed or unsigned. The task is solvable, but see if you can write the shortest code. Rules: Perform the required integer d...
Inspired by Random with your hands tied: The Goal The goal of this challenge is to write a program that generates a pseudorandom bit stream, which is a string of 1s and 0s that appears to be purely random, but is actually generated in a deterministic way. Your program should output a string of 1 and 0s (with optional ...
Definition A square-free semiprime is a natural number that is the product of two distinct prime numbers. The task Given a natural number n, count all square-free semiprimes less than or equal to n. Details Please write a function or procedure that accepts a single integer parameter and counts all square-free semipri...
The 15 Puzzle is a famous puzzle involving sliding 15 tiles around on a 4x4 grid. Starting from a random configuration, the goal is to arrange the tiles in the correct order. Here is an example of a solved 15 Puzzle: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 Each move on the puzzle is of the form Up/Down/Left/Right...
Write programs that produce crazy, obscure, ridiculous, or just plain nutty runtime errors. Obfuscation and golfitude (shortness) not required. solutions that look like they should work fine are better. solutions that look like they should break one way but break another are better. solutions that are nondeterministi...
In the game manufactoria, take in a binary number and output that number of red pieces. The catch? The board-size is only 7x7: Here's the manufactoria code for the problem: http://pleasingfungus.com/Manufactoria/?ctm=Razors;Treat_the_input_as_a_binary_number_and_output_that_number_of_reds;b:r|brr:rrrr|brb:rrrrr|brbb:rr...
Given two integers m and n, return the first m digits of sqrt(n), with the decimal point. They will be given with a space in between. You only have to produce m digits: so if m=5, n=500, then the output will be 22.360, not 22.36067. Do not use anything that will increase the precision of any operation. Test Cases: 20 9...
Given some code in your language as a string, find and display all the variable names. Examples in pseudocode: a=2 b=3 for(i, 0->9) do b=b-10 if a=b then write "a equals b" Returns: a b i abcdefgh=20000000000000 bcdifhgs="hello" if abcdefgh=bcdifhgs then da44="hax" if abcdefgh*2=da44 then write da44 Returns: abcdefgh...
this is the follow-up question to Perfect Hangman in reverse golfers are now asked to develop a program that uses all rules in Perfect Hangman in reverse, instead, playing the player. the program shall ask how many letters you want the word to be, a single required letter, then pick what word is LEAST LIKELY to be gues...
I've designed a new font which I call PrettyFont. I've put much much time into perfecting it, but since I'm a working man I don't have time to finish it. Therefore it only contains 4 characters right now. One day when I've become rich it will become my life-long goal to finish it, but for now... This is PrettyFont: (0,...
If you're not familiar, Dance Dance Revolution is a rhythm game where you hit four receptors (left, down, up, right) with your feet as arrows scroll up the screen. One of the file formats used to lay out the arrow patterns looks something like this: 1000 0100 0000 0011 , A 1 represents a tap note. This chart has a lef...
The proof of the set of characters is that there is a translator which takes any ascii python program as input and produces a limited character set version of the program. The limited character set program can be slower than the original program. It simply has to be possible to produce the same output as the valid pyth...
A simple contest, inspired by this stackoverflow question: You are given an image of a surface photographed by a satellite.The image is a bitmap where water is marked by '.' and land is marked by '*'. Groups of adjacent '*'s form an island. (Two '*' are adjacent if they are horizontal, vertical or diagonal neighbours)...
Draw a tiled cube of any size, in ASCII art. You will be given three numbers a, b and c, and the program should output an a*b*c sized cube. Examples 3 3 3 -> ____ ____ ____ /____/____/____/| /____/____/____/|| /____/____/____/||| |____|____|____|||/ |____|____|____||/ |____|____|____|/ 5 2 3 -> ____ ____ _...
The challenge is rather simple: Take a positive whole number \$n\$ as input. Output the \$n\$th Fibonacci prime number, i.e. the \$n\$th Fibonacci number that is also prime. Input can be as an parameter to a function (and the output will be the return value), or can be taken from the command line (and outputted there...
I work a standard nine to five. Monday through Friday. I take a half hour for lunch from 12:30 to 13:00. Write me a program which, when run, calculates the percentage of the working week that I have completed at the current moment. Rules Only count time actually spent working. I am punctual and do not work over lunch....
In this task you have to write a program that reads a regular expression and generates another program that outputs whether an input string is accepted by that regular expression. The output must be a program written in the same language as your submission. Input The input is a regular expression r matching the followi...
The Challenge Display the alphabet from a given letter read from console input. If the letter is uppercase, you have to display the alphabet uppercased. The alphabet printed must end in the precedent letter of the one inserted. If an additiontal parameter is added to the input (a simple dot .) the alphabet should be pr...
What's the shortest, well-formed C++ code that exhibits undefined behavior?
Suppose you have existing regexes you wish to compile using one of the submissions to Compile Regexes. In as few characters as possible, write a program that: accepts an existing regex as input, as either (a) one line from standard input; or (b) one argument from the command line; or (c) the contents of a textbox in a...
This challenge is based on one proposed on the usenet group rec.games.roguelike.development a few years ago. I can't find the original newsgroup post, but you can have a look a the Github repo of solutions. It was only golfed in a couple of languages and I'd love to see some more! Objective The aim is to build a prog...
How many ways are there to place a black and a white knight on an N * M chessboard such that they do not attack each other? A knight can move two squares horizontally and one square vertically, or two squares vertically and one square horizontally. The knights have to be placed on different squares and the knights att...
Overview: Using you language of choice, implement a complete "half away from 0" rounding function in the shortest amount of code possible. Rules/Constraints: Direct, predefined Round-like functions are not allowed. Floor/Ceiling-type functions are allowed, if your language supports these. Function shall be able to han...
Pretty fun and simple challenge here given any input, create an acrostic poem for that input. you may use any word list of your choosing, and include any code you want to help "smarten" up your acrostic. EXAMPLE Every Xylophone Always Makes Powerfully Low Emissions the winner will be the code chosen by most up-votes...
The challenge Write a program or function that prints stars! The program will receive two parameters by standar input: Size of the star and number of points of the star. A star can be any size between 0 and 10 and have 3, 4 or 5 points. The input parameters are separated by a comma, for example: 5,3 means a size 5 star...