Skip to content

Instantly share code, notes, and snippets.

@markstory
Created September 4, 2010 15:24
Show Gist options
  • Save markstory/565269 to your computer and use it in GitHub Desktop.
Save markstory/565269 to your computer and use it in GitHub Desktop.
<?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";
@milesj
Copy link

milesj commented Sep 4, 2010

Nice error.

@markstory
Copy link
Author

Which error?

@milesj
Copy link

milesj commented Sep 5, 2010

The one that appeared when Graham was selecting the winners :p

@markstory
Copy link
Author

Oh that's graham's computer having world writable files, works for me :)

@milesj
Copy link

milesj commented Sep 5, 2010

Oh well then, Graham fail :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment