Something Fun :D

This is where you share YOUR scripts with others

Moderators: egami, macek, gesf

Post Reply
User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2192
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Fri Jan 06, 2012 6:29 am

Wondering how this is fun..?

LarryMade
New php-forum User
New php-forum User
Posts: 41
Joined: Wed Mar 14, 2012 5:21 am

Wed Mar 14, 2012 9:48 am

Heh, used to do this stuff in BASIC in high school a lot...

For those who cant read the guys code:
It assigns a random lower case letter to $j
Then for the next 100 steps
it prints the step number in bold,
then if the character is divisible by 9 it prints a different random letter, otherwise it prints $j
If the step number is divisible by 10, it inserts a linebreak. That's it.

I found stuff like this way more fun:

Code: Select all

$parts = array('do','wa','po','ti','ka','ee','ay','ing','pl','a','e','y','ch'
,'sh','qu','nu','re','la','to','i','v','re','i','b','rr','oi','g');
$elements = count($parts);
for($numwords = 0; $numwords <10; $numwords++) {
    $numbits = rand(1,15);
    for($count = 0; $count < $numbits; $count++) {
        echo $parts[rand(0,$elements-1)];
    }
    echo '<br />';
}
there, a random word list generator, add more syllables or change them in the $parts array for more variety, you could also use insult adjetives or something else instead of syllables, for a phrase generator. which would be inspiringly freakin mighty mighty freakin completely sublime utterly cool. :D

User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2192
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Wed Mar 14, 2012 10:52 am

I know what it does..
I just don't quite see the humor in it..

LarryMade
New php-forum User
New php-forum User
Posts: 41
Joined: Wed Mar 14, 2012 5:21 am

Thu Mar 15, 2012 7:03 am

When I first discovered some programming concepts I found lots of entertainment in the stupidest things.

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests