Created
September 4, 2010 15:24
-
-
Save markstory/565269 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$filename = '/Users/markstory/Desktop/cakefest_2010_prize_draw.txt'; | |
$file = file_get_contents($filename); | |
$people = explode("\n", $file); | |
$header = <<<TEXT | |
__ __ _ ____ ____ ____ __ _____ | |
/ /` / /\ | |_/ | |_ | |_ | |_ ( (` | | | |
\_\_, /_/--\ |_| \ |_|__ |_| |_|__ _)_) |_| | |
___ ___ _ ___ | |
) ) / / \ / | / / \ | |
/_/_ \_\_/ |_| \_\_/ | |
TEXT; | |
echo $header; | |
echo "\n\n"; | |
echo "Determining winnar:\n"; | |
$loop = count($people); | |
sleep(1); | |
for ($i = 0; $i < $loop; $i++) { | |
$whoIsIt = rand(1 , count($people)); | |
if (isset($people[$whoIsIt])) { | |
$winnar = $people[$whoIsIt]; | |
} | |
echo "."; | |
usleep(700); | |
} | |
echo "\n\nWINNAR IS: " . $winnar . " !!!!!!!!!\n"; |
Oh that's graham's computer having world writable files, works for me :)
Oh well then, Graham fail :P
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The one that appeared when Graham was selecting the winners :p