Code-golf is a competition to solve a particular problem in the fewest bytes of source code.

learn more… | top users | synonyms

7
votes
2answers
194 views

Find real roots of a polynomial

Write a self-contained program which when given a polynomial and a bound will find all real roots of that polynomial to an absolute error not exceeding the bound. Constraints I know that Mathematica ...
2
votes
1answer
293 views

Detect the character encoding of the input

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 ...
7
votes
0answers
129 views

quine-ish tic-tac-toe

Write a program in your chosen language which plays a perfect game of tic-tac-toe on a 3 * 3 board against a human player. However, every move has to be a different program, generated from the ...
4
votes
0answers
81 views

The centers of a triangle

Circles and squares have a single, definite center point. However, the notion of the center of a triangle has long been discussed. Four different centers were known to the Ancient Greeks - the ...
4
votes
0answers
300 views

Unique Sudoku Finder

Challenge: Given a Sudoku board on standard input, find the minimum number of numbers added to make the board unique. Specifics/Rules: The input is formatted as follows (all whitespace is ...
3
votes
0answers
435 views

Blockbox that Hex?

Write a program or a function in any programming language that takes a 6 digit hexadecimal input/argument. The input/argument can be 6 values or a 6 character string. Your program should output an ...
2
votes
0answers
79 views

Write an ASP/Prolog/SAT flow solver

Flow Free is an addictive android game where you have to connect pairs of elements together via non-overlapping snakes and fill the entire grid. For a description, see here: ...
2
votes
0answers
184 views

chess - calculate all legal moves from fen string ignoring castling and en passant

Write the shortest code that calculates all possible (legal) moves of current player from a given FEN string. What is FEN string? (Wikipedia) Shortest code wins, language doesn't matter. Output ...
2
votes
0answers
232 views

Breaking Perfect Hangman in reverse, in reverse

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 ...
1
vote
0answers
113 views

Variable board size 3D Connect Four

Write a 3D version (the game logic being 3D, not the visual representation) of the popular Connect Four game ( http://en.wikipedia.org/wiki/Connect_Four ) where the user can play against the computer. ...
1
vote
0answers
151 views

Convert Regexes

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 to make that work. Equivalent constructs For ...
1
vote
0answers
157 views

Sierpinski triangle using the binary stream

Since a few days we are allowed to draw images at ideone, so my task is to draw a Sierpinski triangle using the binary output stream (first example). Relaed questions:another code golf
1
vote
0answers
186 views

Build an Authenticating SMTP Client

The basic parts of SMTP can be implemented in surprising little code. I was able to build an example SMTP client that works with Gmail and Amazon SES in about 320 characters using PHP. Your task is ...
0
votes
0answers
61 views

Writing firewall rules

Congratulations, you're now a network administrator! As your first task you will need to configure a firewall to stop any traffic to some blacklisted addresses. Unfortunately, the only firewall at ...
0
votes
0answers
211 views

Generate Esolangs

Given a file named hello_world that contains 2-100 bytes of printable ASCII, create a Turing-complete language in which hello_world is a valid program that prints "Hello World!". The output should be ...