Archive for July 10th, 2008

OK, Dustin Diaz (via Paul O’Shannessy) managed to delay my lunch by 30 secs.

var arr = ['a', 'b', 'c', 'c', 'd','e', 'e',
'e', 'e', 'e', 'f', 'e', 'f', 'e',
'f', 'a', 'a', 'a', 'f', 'f', 'f'];
var solution='a b c c d e e <span>e e e</span> f e f e f a a <span>a</span> f f <span>f</span>';
var won = arr.join(' ').replace(/((\w)\s\2\s)((?:\2\s?)+)(?=\s|$)/g, '$1<span>$3</span>') == solution;

Thanks to the wonderful interactive environment of Firefox's "Error Console" (formerly known as JavaScript Console), my pasta didn't get too cold :)

Bad Behavior has blocked 2536 access attempts in the last 7 days.