Now that I have a bit of downtime at work, I've opted to use said time to participate in some of the 52 Weeks of Code challenges I've missed out on in the last few months. First up: Week 22 - the PHP challenge.
In my whopping hour of free time this morning, I whipped up a little generator to determine if any given user may or may not be prey-worthy for my bad-ass cougar self. Though I'm not really old enough for cougardom, I find "I'm a cougar" to have a much nicer ring to it than "I'm a puma". So cougar it is. And it won't be THAT many more years before I actually DO enter the cougar realm... and from there, move on to crazy cat lady territory.
Poorly scripted and loop-infested, I present to you the Official Cougar Calculator!
Please note: In the interest of post length and entertainment value, I have removed some of the conditional statements.
In my whopping hour of free time this morning, I whipped up a little generator to determine if any given user may or may not be prey-worthy for my bad-ass cougar self. Though I'm not really old enough for cougardom, I find "I'm a cougar" to have a much nicer ring to it than "I'm a puma". So cougar it is. And it won't be THAT many more years before I actually DO enter the cougar realm... and from there, move on to crazy cat lady territory.
Poorly scripted and loop-infested, I present to you the Official Cougar Calculator!
Please note: In the interest of post length and entertainment value, I have removed some of the conditional statements.
<?php
if (isset($_POST['submit'])) {
$name=strtoupper($_POST['name']);
$age=$_POST['age'];
$gender=$_POST['gender'];
$guess=$_POST['guess'];
echo "<table style='background:yellow;width:100%;text-align:center;'><tr><td>";
if ($age <= 17) {
$needed=18-$age;
if ($needed==1) {
$years='year';
} else {
$years='years';
}
echo "Sorry, ".$name.", you are far too young for this old lady. Hit me up in ".$needed." ".$years.".<br />";
} else {
if ($guess>=33) {
echo "You think I'm ".$guess."!?!?!? Better start trolling nursing homes if you're looking for one THAT old.<br />";
} else if ($guess<=25) {
echo "You think I'm ".$guess."? Riiight... you're a terrible liar.<br />";
} else {
if ($name=='GABEHABE') {
if ($gender=='M') {
echo "LIES! You're not male!<br />";
} else {
echo "I don't do chicks who are prettier than me.<br />";
}
} else if ($name=='NEOTIFA') {
echo "HAHAHA! Even I'm not THAT crazy.<br />";
} else if ($gender=='F') {
echo "So, you're a chick who digs chicks, ".$name."? I might be down with that... after some imbibing.<br />";
} else {
if ($name=='NO2PENCIL') {
echo "Um, ew. That'd be like banging my brother!<br />";
} else if ($name=='SKYHAWK133') {
echo "Well, hello there, tiger. Do you feel like singing love themes from Top Gun, too?<br />";
} else if ($name=='SUPERSLOTH') {
echo "Is it hot in here or is it just the habaņeros on your taco?<br />";
} else if ($name=='MARTYR2'||$name=='AMADEUS'||$name=='SIXOFELEVEN') {
echo "I hear Canadian bacon is quite tasty....<br />";
} else if ($name=='P4L') {
echo "Dude, srsly, you're, like, married and stuff.<br />";
} else if ($name=='NUMBERWHUN'||$name=='FRINAVALE'||$name=='ZENIST'||$name=='MOTOMA'||$name=='REDSON'||$name=='BANFA') {
echo "Refugees... fresh meat....<br />";
} else if ($name=='KYA') {
echo "Hahahaha! KNOWLES! That name gets me EVERY TIME!<br />";
} else if ($name=='LOCKE') {
echo "Eh... what the hell.... a little emo couldn't hurt...<br />";
} else if ($name=='SETHRO117') {
echo "Can I lick your moobies? PLEASE!?!<br />";
} else {
echo "I think you'll do nicely, ".$name.". Have mah babies?<br />";
}
}
}
}
echo "</td></tr></table>";
}
?>
<html>
<head>
<title>B9's Official Cougar Calculator</title>
</head>
<body>
<h3>B9's Official Cougar Calculator</h3>
<form action='index.php' method='post'>
<table>
<tr>
<td>Your username:</td>
<td><input type='text' name='name' value='' /></td>
</tr>
<tr>
<td>Your age:</td>
<td><input type='text' name='age' value='' /></td>
</tr>
<tr>
<td>Your gender:</td>
<td><input type='radio' name='gender' value='F' /> Female <input type='radio' name='gender' value='M' /> Male</td>
</tr>
<tr>
<td>Guess my age:</td>
<td><input type='text' name='guess' value='' /></td>
</tr>
<tr>
<td colspan='2'><input type='submit' name='submit' value='Submit' /></td>
</tr>
</table>
</form>
</body>
</html>
6 Comments On This Entry
Page 1 of 1
NeoTifa
24 June 2010 - 06:31 PM
else if ($name=='NEOTIFA') {
echo "HAHAHA! Even I'm not THAT crazy.<br />";
Awww, a method just for me... <3
echo "HAHAHA! Even I'm not THAT crazy.<br />";
Awww, a method just for me... <3
Page 1 of 1
Tags
My Blog Links
Recent Entries
Recent Comments
Search My Blog
0 user(s) viewing
0 Guests
0 member(s)
0 anonymous member(s)
0 member(s)
0 anonymous member(s)
|
|



6 Comments









|