#!/usr/bin/php #', $html, $matches); $map_id = $matches[1]; $grid = split( "\n", $html ); $grid = implode ( "", $grid ); preg_match('#
(.*)EOF<\/pre>#', $grid, $matches);
                $grid = $matches[1];

                for ( $i = 0; $i < 100000 ; $i++ ) {
                        while ( $grid[$position] != "#" ) {
                                $next = rand( 0,1 )*2 - 1;
                                if ( $next == 1 ) {
                                        $soln .= "r";
                                }
                                else {
                                        $soln .= "l";
                                }

                                $position += ( 33 + $next );

                                if ( !isset( $grid[$position] ) ) {
                                        $soln = substr( $soln, 0, -1);
                                        shell_exec( 'curl "http://faux.uwcs.co.uk/progcomp20110127/?a='.$soln.'&n=MrWilson&p='.$map_id.'"' );
                                        exit(0);

                                }

                                if ( $grid[$position] == "#" ) {
                                        break;
                                }

                        }
                        $position = 16;
                        $soln = "";
                }
        }

?>