Skip to Main Content
×
Freshbooks
Official App
Free – Google Play
Get it
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 raged 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:

blame.remove(SUNSHINE);
blame.remove(MOONLIGHT);
blame.remove(GOOD_TIMES);
blame.add(BOOGIE);
feet.setControl(null);

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);
}
hammerTime.stop();
$ touch /this
touch: /this: Permission denied

MC Hammer - Can’t Touch This

for (SlimShady ss : slimShadys) {
   if (ss.isReal()) {
      ss.requestPoseChange(STANDING);
   }
}

Eminem - The Real Slim Shady

for (i = countdowns.getFinal(); i >= 0; i--);
setDestination(VENUS);
setPose(Standing.TALL);
addObserver(VENUS.inhabitants());

Europe - The Final Countdown

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

Daft Punk - One More Time

LYRICS = (
   ('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

Rick Astley - Never Gonna Give You Up

getItOn: function(baby) {
      if (baby.curPos != spirit.move.call(baby).curPos) {
         this.groove(baby);
      }
   },
   groove: function(baby) {
      // this is a family blog
   }
};

Marvin Gaye - Lets Get It On

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

Jay-Z - 99 Problems