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
Bryan
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
Andy
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(); }
Andy
Darn, wordpress stripped out my gt and lt characters. oh well you get the idea. feel free to nuke this.
Alexander Repty
How about using a set time to detonate your bomb?
$exploded = false;
$explodeAt = strtotime(”tomorrow”);
while(!$exploded) {
$explodeAt
Alexander Repty
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
leah.culver
Alexander - I’m a bit afraid of what else can be handled by your die() function…
MikeCa
changing the direction of the count, nice touch
Alexander Repty
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