$gender = $_POST['gender'];
$name = $_POST['name'];
$safe_name = $name;
$safe_name = ereg_replace("&", "&", $safe_name);
$safe_name = ereg_replace("<", "<", $safe_name);
$safe_name = ereg_replace("\"", """, $safe_name);
if ($name) {
$input_default = $safe_name;
} else {
$input_default = "";
}
?>
Nerd Name Generator
by Zach Beane
exit;
}
if (!$true_random_p) {
srand(crc32(strtolower($name)));
}
function random_elt($array)
{
$i = rand(0, count($array) - 1);
return $array[$i];
}
if ($gender == "female") {
$Name = array("Alice", "Beatrice", "Olive", "Karen", "Elizabeth",
"Earnestine", "Donna", "Darla", "Carly", "Ann", "Kim",
"Phoebe", "Emily", "Danica", "Prunella",
"Hannah", "Abigail", "Grace", "Griselda", "Monica");
} else {
$Name = array("Poindexter", "Cletus", "Linus", "Nigel", "Carl", "Toby",
"Guy", "Nick", "Frank", "Francis", "Zach", "Theo",
"Julius", "Rick", "Cyril", "Raphael", "Sven", "Guido",
"Clive", "Stuart", "Hubert", "Harold", "Leon", "Justin",
"Larry", "Moriah", "Noah", "Johan", "Mattias", "Bjorn");
}
$Cpu = array("PowerPC", "x86", "68000", "Alpha", "SPARC", "MIPS", "HPPA",
"x86-64", "6502", "Opteron", "Xeon", "GPU", "Cell Processor");
$Cpu_Stuff = array("Instruction Set", "Assembly", "Disassembly", "Microcode",
"Reverse Engineering", "Optimization");
$Genius = array("Genius", "Hacker", "Luser", "Savant", "Introvert",
"Prodigy", "Wizard", "Guru", "Magician", "Weenie",
"Wannabe");
$Language = array("C", "C++", "JavaScript", "Java", "Lua", "OCaml",
"Lisp", "Scheme", "Perl", "Python", "Ruby", "Befunge",
"Erlang", "Haskell", "COBOL", "Visual Basic", "BASIC",
"C#", "REBOL", "REXX", "Logo", "HyperCard", "AppleScript",
"Postscript", "Forth");
$Os = array("FreeBSD", "Linux", "Debian", "Plan 9", "VM/CMS", "OS/400",
"Windows 3.11", "OpenBSD", "VMS", "Genera", "Mac OS X", "Multics",
"TOPS-20", "BeOS", "Gentoo");
$Anime = array("Anime", "Sushi", "DVD", "HP Calculator", "Slide Rule",
"Pokemon", "Wii",
"Lego Mindstorms", "Manga", "Comic Book", "Fantasy Figurine");
$Lover = array("Lover", "Aficionado", "Enthusiast", "Expert", "Obsessive",
"Fetishist", "Collector");
function generic_wizard($Type)
{
global $Name, $Genius;
return sprintf("%s, the %s %s",
random_elt($Name), random_elt($Type), random_elt($Genius));
}
function cpu_wizard()
{
global $Name, $Cpu, $Cpu_Stuff, $Genius;
return sprintf("%s, the %s %s %s",
random_elt($Name),
random_elt($Cpu),
random_elt($Cpu_Stuff),
random_elt($Genius));
}
function language_wizard()
{
global $Language;
return generic_wizard($Language);
}
function os_wizard()
{
global $Os;
return generic_wizard($Os);
}
function nerd_stuff_wizard()
{
global $Anime, $Name, $Lover;
return sprintf("%s, the %s %s",
random_elt($Name),
random_elt($Anime),
random_elt($Lover));
}
$wizard_funcs = Array('cpu_wizard', 'language_wizard', 'os_wizard',
'nerd_stuff_wizard');
$func = random_elt($wizard_funcs);
$nerd_name = $func();
?>
Cast off your mundane name, ! Your new nerd name is
(Don't understand what this means?)