Skip to Main Content
Official App
Free – Google Play
FreshBooks is Loved by American Small Business Owners
FreshBooks is Loved by Canadian Small Business Owners
FreshBooks is Loved by Small Business Owners in the UK
Dev Blog

Song In Code Contest Winners

by Anton Nguyen on September 8/2011

We recently held a contest to see all the creative ways you could turn your favourite songs into code. Everyone submitted so many amazing entries, that it made it almost impossible to pick our favourite submission!

We long and hard, debating who should come out on top. After the dust had settled and votes were counted, there emerged a victor: Hong Hua with his entry of Aladdin’s “A Whole New World”!

Congratulations Hong! You’ll be receiving a $100 Amazon Gift Certificate!

John Girvin came in a close 2nd place with his entry of “Blame it on the Boogie”. We thought he deserved a prize as well for all his hard work, so he’ll also receive a $50 Amazon Gift Certificate consolation prize!

Thanks to everyone who participated! We hope you had fun!

The Winning Entry

A Whole New World – Aladdin

Codified by Hong Hua

Song Lyrics:

_A whole new world

A hundred thousand things to see_

Song In Code:

World *newWorld = [[world alloc] init];
int thingsToSee = 0
for (thingsToSee; thingsToSee < 100000; thingsToSee++)
   [newWorld seeThings: thingsToSee];
[newWorld release] //clean up after magic carpet ride

The way Hong codified these lyrics was simple and clever. There's the initialization of the world, then looping of all hundred thousand things to see, and finishes it off on a nice touch with excellent memory management!

The Runner-Up

Blame It On The Boogie - The Jacksons

Codified by John Girvin

Song Lyrics:

_Don't you blame it on the sunshine

Don't blame it on the moonlight

Don't blame it on the good times

Blame it on the boogie_

I just can't

I just can't

I just can't control my feet

Song In Code:


With his code, all the blame is removed and only "Boogie" is added back. What really won us over, is how at the end, feet control gets set to null.

A few other great entries

if (touchers.contains(you)) {
   throw new InvalidOperationException(CANT);
$ touch /this
touch: /this: Permission denied

for (SlimShady ss : slimShadys) {
   if (ss.isReal()) {

for (i = countdowns.getFinal(); i >= 0; i--);

while (TRUE)
   [self celebrate:oneMoreTime];
[dancing stop];

   ('give you up'),
   ('let you down'),
   ('run around and desert you'),
   ('make you cry'),
   ('say goodbye'),
   ('tell a lie and hurt you'),
for lyric in LYRICS:
   print 'Never gonna ', lyric

getItOn: function(baby) {
      if (baby.curPos != {
   groove: function(baby) {
      // this is a family blog

>> problems.count
=> 99
>> problems.include?(:female-dog) # this is a family blog
=> false