Harsh J

Memoirs of a QWERTY Keyboard

Archive for the ‘puzzle’ tag

Look and Say Sequence

7 comments

Have no idea why it took near 2 hours for me to write this. Maybe it was the stupid OOP paper I gave today, I’ve been in a bad mood after writing a 40-pager and yet feeling unsatisfactory about it. :?

So back to the post’s topic: The Look and Say Sequence, which I found today while solving the level 10 of The Python Challenge, is a very odd sequence of numbers which are formed by counting and spelling out the digits sequentially.

The series looks like the following:

1 11 21 1211 111221 and so on …
How this is formed:
See the first digit 1. Spell it as One One (One in quantity that is). This is the general idea.
Thus:
1 – One One: 11
11 – Two One(s): 21
21 – One Two and One One: 1211
1211 – One One, One Two and Two One(s): 111221
And on and on and on …

And now, for the Python Code.

( Took me over 80 minutes with lots of scrapping and frustration to write. Bad day :( )

Written by Harsh

November 29th, 2007 at 1:17 am

An old yet complex Programming Puzzle

one comment

Found this today while browsing del.icio.us.

Visit: The Python Challenge

(Actually its not necessary you should use Python just cause its named so. Its a regular programming puzzle and you should do just fine with any modern language such as PHP or Java as well. C/C++ might be a bit tedious for use here.)

The good thing about this kind of a challenge is that you never ever would encounter a dead end. Its all possible and you probably know how too, but the answer always depends on how you implement your program to solve things for you. Awesome way to learn and practice code!

Am currently on level 5, having just begun. There are a total of 33 levels currently.

Note: If you are solving it, please refrain from posting spoilers here. Defeats the purpose of the entire ‘programming puzzle‘ if you post code, etc. You may post tips though, that’d be helpful, or at maximum, the basic under-lying algorithm required to crack it.

Enjoy! :D

Written by Harsh

November 27th, 2007 at 6:52 pm

Posted in Fun,Internet

Tagged with , , ,