Page List

Search on the blog

2011年3月18日金曜日

Started a new contest!

I've started a new contest, called "Code Golf," where you compete in the size of source code.


You are given a not-so-difficult program, and all you have to do is write a code as short as possible :)

They allow you to submit in a couple of programming languages: PHP, Python and Perl.
It doesn't help at all in everyday's coding lol
But people on the site are keen on just shortening their codes. Talk about a computer hacker lol

I will hack too, haha.

Here's a simple problem I solved today.

This is my (first) code.
Nothing special, an ordinary code on which no shortening effort is done.
I'll make this shorter somehow!!!



a=[1]
for i in range(34):
for x in a:
print x,
print
a = map(lambda x:sum(x),zip([0]+a,a+[0]))

(追記)
がんばって10バイト減らした。不毛な努力(笑)
でも、そこがいい。

0 件のコメント:

コメントを投稿