What is Code Golf?

Based on the original perl golf, Code Golf allows you to show off your code-fu by trying to solve coding problems using the least number of keystrokes.

You're not just limited to Perl either - PHP, Python and Ruby are all available too.

Challenges are always open, and your entries are automatically scored so you can start playing right away!

News [View All] [RSS Feed]

Saving Time

Posted 29.08.2008 by carldr.

It's not quite a record given it's been only 217 days since Choose was added to the site, but we have a new challenge for you.

The challenge involves representing a time given in digital format (ie, hh:mm) on an analogue-style clock face. As usual, the challenge description gives you all the information you require - Visit it at Saving Time.

Thanks go to Arpad Ray for sending in this challenge.

Choose

Posted 15.01.2008 by carldr.

We had planned to release this challenge a little earlier than this, but with the holidays and all, it got a little delayed.

The challenge asks you to calculate how many different ways you can pick a certain number of items from a larger set of those items. Don’t be scared off if you don’t know how to do this, all the information you need is in the challenge description. Visit the Choose challenge page.

Thanks go to Flagitious for sending in this challenge.

Something that might be of interest to you Code Golfers – Flagitious recently created a language called GolfScript. which was designed specifically to be good for golfing. Please visit the site and have a look.

To give you an idea of how good it is, this challenge can be solved in 21 bytes in GolfScript, which he estimates being half the size of what the winning submission on Code Golf will be!

Grid Computing

Posted 06.12.2007 by carldr.

Wow, it only seems like 236 yesterdays ago when we added the Tower of Hanoi challenge!

But here you are – Something new to play with. It’s a nice and simple one, involving finding the row or column in a grid of numbers which has the highest aggregate total. Read all about it on the Grid Computing challenge page, where you’ll see all the information you need.

Thanks to Ciaran Walsh for submitting the challenge.

So, how long until the next challenge you might ask? Who knows, but I’m pretty sure it’s going to land in less than 237 days.

Tower of Hanoi

Posted 13.04.2007 by carldr.

To celebrate the first Friday the 13th of 2007, we have a new challenge for you kerrrazy golfers. I’m sure most of you have heard of the Tower of Hanoi. This challenge requires you to take a starting position of the puzzle and organise the pegs onto one peg. Read all about it on the Tower of Hanoi challenge page, where you’ll see all the information you need.

I’m going to make the bold promise that we’ll have a new challenge next Friday, but I’ve said that before so we’ll see if it actually happens!

Join The Fun!

If you're enjoying Codegolf, how about visiting our IRC channel? Get help with your challenges, talk to the regular (and not so regular) players, give us your feedback and generally join in the Code Golf community.

#codegolf on irc.freenode.net

Top Golfers [View All]

View the Overall | Perl | PHP | Python | Ruby

Rank User Score [?]
1st shinh 256,928 (28 challenges)
2nd flagitious 253,400 (28 challenges)
3rd ySas 244,532 (27 challenges)
4th kounoike 228,964 (27 challenges)
5th yvl 221,929 (28 challenges)
6th 0xF 221,516 (28 challenges)
7th ozy4dm 207,534 (27 challenges)
8th Mark Byers 203,791 (28 challenges)
9th ott 189,919 (24 challenges)
10th hallvabo 184,006 (27 challenges)

Latest Challenges [View All]

Guns And Zips
Something to keep you busy
over 2 years old.
Saving Time
A Byte In Time Saves Nine
over 3 years old.
Choose
What language will you choose?
over 4 years old.
Grid Computing
We're Back!
over 4 years old.
Tower of Hanoi
To recurse, or not to recurse, that is the question.
about 5 years old.

Active Challenges [View All]

99 Bottles Of Beer
Does your code sing?
23 entries in the last seven days.
Polynomial Division
Because algebra is fun!
9 entries in the last seven days.
Roman to Decimal
Lazy Cows Don't Moo.
4 entries in the last seven days.
Home On The Range
It's as simple as "1 2 3 5 6 8" => "1-3, 5-6, 8."
3 entries in the last seven days.
Prime Factors
Work out the prime factors of a given number.
3 entries in the last seven days.