Stuffy Noses

Stuffy noses suck. I’ve got the stuffy nose, watery eyes, need-to-blow-my-nose-every-five-minutes thing going on right now.

I went out for my Valentine’s Day dinner date last night with Daniel at Foreign Cinema. After drinking half a bottle of wine, I thought the paper table cloth covers looked good for writing on and attempted to teach Daniel all about while-loops. After twenty minutes of scribbling code on the table, Daniel remarked that it looked an awful lot like a formula for bomb-making. I assured him that bombs probably aren’t written in php and

$count = 0;
while ($count < 10) {
echo $count;
count++;
}

is far less suspicious than

$count = 10;
while ($count >= 0) {
tick();
echo $count;
$count--;
}
goBoom();

And now while you ponder better bomb-making algorithms, I’m going to go blow my nose.

Seriously, bombs are terrible. I would never try to make one and I strongly discourage others from doing so.

8 Comments

  1. Posted February 13, 2007 at 7:45 pm | Permalink

    Hmmm, I’ve never thought about showing a girl how to code on a date. I may have to give this a try tomorrow night lol :)

  2. Andy

    Posted February 13, 2007 at 9:31 pm | Permalink

    how about Java beans blowing up in your face? blow daniel away with for-each loops, generics, and ternary operators. :)
    Carafe carafe = getCoffees();
    for(Coffee cup : carafe) { ( !isTimeUp() ) ? tick() : goBoom(); }

  3. Andy

    Posted February 13, 2007 at 9:32 pm | Permalink

    Darn, wordpress stripped out my gt and lt characters. oh well you get the idea. feel free to nuke this. :)

  4. Posted February 14, 2007 at 1:29 am | Permalink

    How about using a set time to detonate your bomb?

    $exploded = false;
    $explodeAt = strtotime(”tomorrow”);
    while(!$exploded) {
    $explodeAt

  5. Posted February 14, 2007 at 1:33 am | Permalink

    It seems my code got messed up. Here’s something which should work and uses a set time instead of a countdown:

    http://proculo.de/other/code/boom.phps

    Cheers,
    Alex

  6. Posted February 14, 2007 at 12:49 pm | Permalink

    Alexander - I’m a bit afraid of what else can be handled by your die() function…

  7. Posted February 14, 2007 at 6:27 pm | Permalink

    changing the direction of the count, nice touch

  8. Posted February 15, 2007 at 1:26 am | Permalink

    Leah,

    I have to admit it sounds a little morbid… but as long as I keep my bomb-making limited to PHP code, I think I’m good. :)
    Cheers,
    Alex