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

  • A quick note

    Posts on Coyote Tracks are supposed to be cross-posted here, but it's clear the cross-poster isn't, er, posting. I apologize. I'll look into it,…

  • A better Amaretto Sour

    I’m pretty sure I was introduced to the amaretto sour in college by my roommate’s girlfriend. I liked it—because I like amaretto—but I…

  • Cotton, hay, and rags: giving bias the veneer of rationality

    As you’ve surely heard by now, a mid-level engineer at Google—he’s anonymous, so I’ll call him Mr. Rationalface—wrote a memo called…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded