Gå til innhold

"What if Dr. Seuss wrote computer manuals?"


DrDoogie

Anbefalte innlegg

What If Dr. Seuss Wrote Computer Tech Manuals?

If a packet hits a pocket on a socket on a port,

And the bus is interrupted as a very last resort,

And the address of the memory makes your floppy disk abort, Then

the socket packet pocket has an error to report!

If your cursor finds a menu item followed by a dash,

And the double-clicking icons put your window in the trash, And

your data is corrupted 'cause the index doesn't hash, Then your

situation's hopeless, and your system's gonna crash!

If the label on your cable on the gable at your house,

Says the network is connected to the button on your mouse,

But your packets want to tunnel to another protocol,

That's repeatedly rejected by the printer down the hall.

And your screen is all distorted by the side effects of gauss, So

your icons in the window are as wavy as a souse, Then you may as

well reboot and go out with a bang, 'Cause as sure as I'm a poet,

the sucker's gonna hang!

When the copy of your floppy's getting sloppy on the disk,

And the microcode instructions cause unnecessary RISC,

Then you have to flash your memory and you'll want to RAM your

ROM, Quickly turn off your computer and be sure to tell your mom!

Lenke til kommentar
Videoannonse
Annonse
Jeg håper virklig ikke at DrDoogie har kodet dette selv :p

Nope. Dvs., "kodet", jo.

 

#! /usr/bin/perl 
# Purpose: 
#         Mess up the colors of characters input to the script. Pointless, you say? Why of course.

# 1. Fill array with colorstrings
# 2. Read inputstring(s)
# 3. Randomize each character's color
# 4. Print out

::smack_my_text_up ();

sub smack_my_text_up {
       my @colors = ::fill_array_with_colorstrings ();
       my ($color_index, $prev_index); 
       while (<>) {
               chomp;
               my $line = $_;
               for my $i (0..length $line) {
                       # Surround the original character with escape sequences 
                       # that change the color of the text before the character, 
                       # and resets the color after the character.
                       if (substr ($line, $i, 1) =~ /\s/) { print ' '; next; }
                       do { $color_index = int (rand (scalar @colors)); } while ($color_index == $prev_color);
                       print "[color=", $colors[$color_index], "]", substr ($line, $i, 1), "[/color]";
                       $prev_color = $color_index;
               }
               print "\n";
       }
};

sub fill_array_with_colorstrings {
       my @list_of_text_colors = qw(blue red purple orange yellow gray green);
       return @list_of_text_colors;
};

 

Enjoy!

Endret av DrDoogie
Lenke til kommentar

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
  • Hvem er aktive   0 medlemmer

    • Ingen innloggede medlemmer aktive
×
×
  • Opprett ny...