Oh look, I have a blog! Hey! I have a blog!

Oh wow, I have a blog!

Every human has the wonderous ability to forget things. Usually that involves keys, handbags, phones and passports. In my case it’s that I have a blog.

Recently I discovered Code Golf. Essentially it’s writing a program, or part of a program to solve a fairly simple task but trying to do it in as little code as possible. So something like working out the fibbonacci sequence goes from

a = 1
b = 1
for i in range( input() ):
c = a + b
a = b
b = c
print(a)

which is fairly easy to read, to:

a=b=1
for i in range(input()):a,b=b,a+b
print a

Ok, bad example… That’s not that much harder to read but that’s because I chose a easy to read language in the first place :/

You get the idea though. Take a piece of code and make it as short as possible. Which means that some languages get to code like:

^2,*+*...*

Or:

1.@{.@+}*;

Which is plain annoying. And I don’t understand them. [Taken from here]

Some of the questions are quite simple, whilst some of the others get a little more complex, like for example trying to find the quickest route through a city which takes not only skill but a lot of knowledge…

Like seriously. I wouldn’t even know how to get through here and I’m good at map reading…

So yeah. I try. I fail but it’s all learning and soon I’m sure I might get in the realm of single digit length code :p

Just as an extra, someone did actually solve that map, and it took a fair amount of time; check it out!

This entry was posted in Programming and tagged , . Bookmark the permalink.

Leave a comment