Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Poem Generator
- // Michael Craft
- // 3/2/09
- // This code is realeased under the MIT license, which gives you the right to use, distribute, and modify as long as you give me credit.
- $article = array("the","a","an","some","any");
- $adj = array("purple","stinky","stupid","fat","nasty","ugly","awesome","cool","hot","cold","green","blue","dead","soft","hard","wet","dry","black","white","racist","alive","squishy","skinny","round","square","triangular","technologic");
- $noun = array("cat","dog","bat","hat","rat","table","pen","pencil","crayon","folder","computer","backpack","paper","stapler","USB drive","pencil sharpener","chair","car","pool","ball","light","lamp","cord","plug","spike","bomb","fuse","mummy","skeleton","keyboard","taco","xylophone","trombone","trumpet","tuba","afro","elephant","girrafe","zebra");
- $verb = array("run","jump","shoot","sprint","talk","die","explode","stab","trip","fall","play","move","type","print","eat","drink","punch","kick","point","make","create","cook","turn","drive","touch","bring","pay","watch","leave","stop","format","buy","use","break","fix","trash","change","mail","upgrade","charge","point","zoom","press","snap","work","erase","write","cut","paste","save","load","check","rewrite","plug","play","burn","rip","drag","drop","zip","unzip");
- $prep = array("at","in","from","with","by","about","under","along","before","of");
- $final = <<<EOD
- {$article[array_rand($article)]} {$adj[array_rand($adj)]} {$noun[array_rand($noun)]}<br />
- {$verb[array_rand($verb)]} like {$article[array_rand($article)]} {$noun[array_rand($noun)]}<br />
- {$prep[array_rand($prep)]} {$noun[array_rand($noun)]}<br />
- I {$verb[array_rand($verb)]}<br />
- {$prep[array_rand($prep)]} {$noun[array_rand($noun)]}<br />
- and {$verb[array_rand($verb)]}<br />
- {$prep[array_rand($prep)]} {$noun[array_rand($noun)]}<br />
- {$article[array_rand($article)]} {$noun[array_rand($noun)]} was like {$article[array_rand($article)]} {$noun[array_rand($noun)]}<br />
- the {$noun[array_rand($noun)]}<br />
- {$verb[array_rand($verb)]}<br />
- {$prep[array_rand($prep)]} {$noun[array_rand($noun)]}
- EOD;
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Poem Generator</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <link rel="stylesheet" type="text/css" href="../peak15.css" />
- </head>
- <body>
- <h1>Poem Generator</h1>
- <h3>By Michael Craft</h3>
- <p><?php echo $final; ?></p>
- <p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml11-blue" alt="Valid XHTML 1.1" height="31" width="88" /></a>
- <a href="http://jigsaw.w3.org/css-validator/check/referer">
- <img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!" /></a></p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement