Watts (chipotle) wrote,

If you don't understand this, be glad

This wins the internets: combining geek (and I mean, really geek) humor and Led Zeppelin.

stevenf’s zep.pl

*** Black Dog achieved in 36 ZepMarks ***

Naturally, someone else ported it to Python. And, because I’m just like that, I ported it to Ruby:

#!/usr/bin/env ruby

words = ['hey', 'mama', 'said', 'the', 'way', 'you',
  'move', 'gonna', 'make', 'sweat', 'groove']

success = [ 0, 0, 1, 2, 3, 4, 5, 6, 7,
  8, 5, 9, 7, 8, 5, 10]

iterations = 0
matches = 0
matched = Array.new

while matches < 16
  iterations += 1
  print "[#{iterations}] "

  0.upto(15) do |i|
    if matched[i]
      print words[success[i]], ' '
      r = rand(11)
      print words[r], ' '
      if r == success[i]
        matches += 1
        matched[i] = true

  print "\n"

puts "*** Black Dog achieved in #{iterations} ZepMarks ***"

(Oh, c’mon, it was only 604 bytes — don’t whine about it needing an LJ cut!)

Tags: internet, programming

  • Marching sideways

    It’s been almost a month since I’ve updated my LiveJournal. I see I wrote then, “I feel like I should be taking an entirely…

  • Geek question

    Do any of you, by which I mean “anyone reading this,” know Django? This is not a trick question, by which I mean “this is a…

  • The future of online news, in 1981

    (From TechCrunch, via the New York Times’ Opinionator blog.) This brings me a certain level of nostalgia: the customer reading the…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded