;if($#o!=$#a-1){print"$#o != $#a-1";exit(2);}$x=0;$x++until$a[0][$x]eq"X";shift@a;foreach(@a){@t=@{$_};pop@t;if((shift@o)eq"l"){$x--}else{$x++}$d|=$t[$x]eq"#";$t[$x]=$d?"D":"X";print@t,"\n"};exit$d\' 2>&1 ' . $ans , $arr, $exit); if ($exit == 2) msg("$nick:$file:$ans: Input, '$ans', is the wrong length: " . implode("\n", $arr)); $help = implode("\n", $arr); echo "\n\n"; echo "$help\n\n"; if ($exit == 1) msg("$nick:$file:$ans: Solution is the correct length, but causes DEATH"); $age = time() - $st['ctime']; if ($age > $ma) msg("$nick:$file:$ans: Correct, but too olde: $age > $ma seconds"); echo "WINNER IS YOU\n\n"; echo "Answers to pfx-progcomp20110127@goeswhere.com or Faux/FauxFaux on IRC, with source (please!).\n\n"; $m = "$nick:$file:$ans:" . date("c") . ":"; $m .= substr(sha1($m . "I LOVE HORSES, BEST OF ALL THE ANIMALS"), 30) . "\n"; msg($m); } function msg($m) { file_put_contents("winners.txt", "$m\n", FILE_APPEND); die($m); } $maxlen = 60; function make() { global $maxlen; $w = rand(30, 40); $h = rand(50, $maxlen); $rapers = 10; $rape = array(rand(20/$rapers, $h/2/$rapers)*$rapers, rand($h/2/$rapers, $h/$rapers)*$rapers); $s = ""; for ($y = 0; $y < $h; ++$y) { $ll = rand(1,4); $lr = rand(1,4); $super = rand($w/4,$w/2+$rapers-1); if (in_array($y, $rape)) $super = $w/2+1; if ($y % $rapers == 0) if (rand(0, 2) == 0) $ll = $super; else $lr = $super; if ($y == $rape[0]) { $ll = $super; $lr = 1; } else if ($y == $rape[1]) { $lr = $super; $ll = 1; } if ($y == 0) $ll = $lr = 1; for ($x = 0; $x < $ll; ++$x) $s .= "#"; for (; $x < $w - $lr; ++$x) if ($x == (int)($w/2) && $y == 0) $s .= "X"; else $s .= "."; for ($x; $x < $w; ++$x) $s .= "#"; $s .= "\n"; } return $s; } $f = tempnam($td, "map"); while (true) { $s = trim(make()); file_put_contents($f, $s); $ret = 7; $arr = array(); exec('<' . $f . ' perl -we \'@a=map{[split//]}<>;$x=0;$x++until$a[0][$x]eq"X";$y=0;my@r;my@q;while($y<$#a){exit(1)if($y<0);$y++;if("#"eq$a[$y][$x+1]){if("#"eq$a[$y][$x-1]){$a[$y-1][$x]="#";$y-=2;$x=pop@q;pop@r}else{push@r,"l";push@q,$x--}}else{push@r,"r";push@q,$x++}}print@r\'', $arr, $ret); if (0 == $ret) break; } ?> Progcomp!

Progcomp!

Objective

You start at the X. You can only go left or right. Get to the bottom without hitting a #.

Answer format is the move you want to take at each line; 'l' for left and 'r' for right. All other characters will be ignored. An example is provided.

You have seconds.

Your map

If your browser supports it, this has been copied to your clipboard (IE8 does, Chrome doesn't). Sorry if it SPAMMED YOU WITH MESSAGES.



EOF

FORM