Famous Songs in Code (What’s Your Guess?)

Inspired by Philipp Lenssen’s fabulous idea to express idioms in code, I came up—just for fun—with the following 10 well-known song titles, written in horrible C/Java/PHP pseudocode.

Have fun… and take a guess in the comments!

// Song 1:
it = b

// Song 2:
for (i=0; i<people.count(); i++)
  people[i].attributes |= (shiny | happy);

// Song 3:
function get(want) {
  if (random.bool() == true)
    return want;
  else
    return null;
}

// Song 4:
//function leave() {
//  return new Color(0,0,0);
//}
// Oh, I think I screwed this one up, so here it goes:
// Version 2.0 of Song 4: ;-)
function leave(me) {
  me.setColor(0,0,0);
  return me;
}

// Song 5:
who = fire.getStarter();
assert(who != us);

// Song 6:
function cry(person) {
  return (person.gender == female);
}

// Song 7:
person = king.getWife();
person.dance();

// Song 8:
life = me.getLife();
life.setSunshine(you);

// Song 9:
person = USGovernmentEmployees.getRandom();
while (person.boss != null)
  person = person.boss;
person.writeLetter();

// Song 10:
train = trains.getLine(A);
you.take(train);

Update: I fixed Song 4 and 9 because they made way too little sense. Oops ;)



25 Responses to “Famous Songs in Code (What’s Your Guess?)”

  1. 1. Let it be (Beatles)
    2. Shiny Happy People (REM)
    3. You Can’t Always Get What You Want (Rolling Stones)
    4. ?
    5. Start the fire (No Doubt) ?
    6. Cry Baby (Janis Joplin, Mariah Carey, Various) ?
    7. Dancing Queen (ABBA)
    8. You are the sunshine of my life (Stevie Wonder)
    9. ?
    10. Take the A-train (Duke Ellington, Various)

    Are my guesses. :-)

  2. 1. let it be
    2. Shiny Happy People
    3. ?
    4. fade to black ?
    5. I’m the fire starter.
    6. no woman no cry ?

  3. These are hard. :)

    2. Shiny Happy People

    5. We didn’t start the fire

    8. You’re not the boss of me now. (?)

  4. I love it! And other than #2, I’m not 100% sure of any of them. :(

    Like, #5 – I thought that would be Prodigy’s Firestarter, but the lyrics definitely have “us” being one of the firestarters, so I got nothin.

    Nice work though.

    Edit: Oh! It’s Billy Joel’s We didn’t start the fire! Yesss, I got another one. :)

  5. Ok, I was *really* bored and got most of the titles. But I couldn’t find out songs 4 and 9. They really gave me a headache. :/

    **** SPOILER ALERT ****

    Song 1: The Beatles – Let it be
    Song 2: REM – Shiny happy people
    Song 3: Jimmy Cliff Lyrics – You Can Get It If You Really Want
    Song 4: ??? maybe “Back in black” by AC/DC…well, maybe not…
    Song 5: Billy Joel – We Didn’t Start the Fire
    Song 6: Bob Marley – No Woman No Cry
    Song 7: ABBA – Dancing Queen
    Song 8: Stevie Wonder – You Are The Sunshine Of My Life
    Song 9: ??? it could be “Hello Mr. President” or something similar
    Song 10: Duke Ellington – Take The A Train

  6. 1. Let it be – The Beatles
    2. Shiny Happy People – REM
    3. You can’t always get what you want – The Rolling Stones.
    4. Fade to Black – Metallica ?
    5. We didn’t start the Fire – Billy Joel
    6. When She Cries – Restless Heart
    7. Dancing Queen – ABBA
    8. You Are The Sunshine Of My Life by Stevie Wonder
    9. Dear Mr President – Pink
    10. Take the A train – Duke Ellington

  7. I would say
    #3: Rolling Stones: Can’t Always Get What You Want

  8. #3 is “You Can’t Always Get What You Want” by the Stones.
    #4 might be “Paint It Back”, also by the Stones
    and #9 has me stumped, too.

  9. 3 is definitely “You can’t always get what you want” (Rolling Stones)
    4 could be “Paint it black” (Stones too)
    6 I’d vote for “Boys don’t Cry” (The Cure)

  10. Hm, interesting guesses, joschi… I may be completely off track here, but I disagree with some of them:

    3. You can’t always get what you want – Rolling Stones
    6. Boys Don’t Cry – The Cure (just grasping at straws when I guessed this one, but felt it worth mentioning).
    9. Won’t Get Fooled Again – The Who (“meet the new boss… same as the old boss…” – I know, I know, not a title, but the best I could do!)

  11. 1. Let it be
    2. Shiny happy people
    3. You can’t always get what you want
    4. Fade to black -OR- Back in black — Neither works very well.
    5. We didn’t start the fire
    6. Boys don’t cry
    7. Dancing Queen
    8. You are the sunshine of my life
    9. ???
    10. Take the A train

  12. 9 Maybe “Dear Mr. President” ???

  13. i guessed song 6 as “boys don’t cry” by the cure

  14. Hah! You guys are awesome.

    And your guesses were really, really good! I apologize for the ones that were probably too fuzzy (in particular number 4 and number 9!) but nonetheless some of you even got these right, wow! (In number 9, now that I think of it, greet() should have better been writeLetter() or so.)

    ************** SPOOOOOOILER!! *****************
    So here’s what I intended them to be:
    .
    .
    .
    .
    1. Let it be (Beatles)
    2. Shiny Happy People (REM)
    3. You Can’t Always Get What You Want (Rolling Stones)
    4. Back in black (AC/DC)
    5. We didn’t start the Fire (Billy Joel)
    6. No Woman No Cry (Bob Marley)
    7. Dancing Queen (ABBA)
    8. You Are The Sunshine Of My Life (Stevie Wonder)
    9. Dear Mr President (Pink)
    10. Take the A train (Duke Ellington)

    Well done, everybody! Looks like I gotta think of some more :)

  15. […] En Fredericiana han escrito una entrada bastante simpática en el que hay que adivinar el título de varias canciones a partir de pequeños programas en pseudocódigo. A ver qué tal se os da. Tenéis las soluciones en los comentarios. // Canción 1: it = b // Canción 2: for (i=0; i […]

  16. Why do you not use Javascript for song 1 and declare ‘it’ with let? ;)

  17. Good idea, Henrik :) If I was coding Haskell here, that would work also.

  18. Canciones famosas en pseudocódigo [eng]…

    Frikada máxima: canciones míticas descritas mediante pseudocódigo. A ver cuántas adivináis. Vía (en español): mundogeek.net/archivos/2008/02/25/canciones-famosas-en-pseudocodigo/…

  19. […] Famous Songs in Code (What’s Your Guess?) […]

  20. […] tal lo que encuentro en Fredericiana ? Canciones escritas en codigo fuente, haber si pueden decirme cual canción es… // Canción […]

  21. Darn it was a toss up for me between Back in Black and Fade to Black. But now I think I get that one better so it makes sense.

    The idioms were awesome too. They were easier though.

  22. Brian: No worries — as I said, I made this one way too fuzzy. Hope you had fun anyway! :)

  23. #2 is shiny happy people by rem.

  24. Hahahaha, those are all wonderful!!

    -Max

  25. 1) Let It Be
    2) Shiny Happy People
    3) You Can’t Always Get What You Want
    4) Back in Black
    5) Light My Fire
    6 & 7 stumped me . . . .
    8) You Are the Sunshine of My Life
    9 & 10 stumped there too

Leave a Reply