Apr 03, 2007 23:51
So today I wrote the help file for my Strings computer architecture program. I am pretty happy with it. I also finished the program, but the program is due on Thursday, so I don't wanna do something silly like post the source code on the internet. Anyway, the help file is really funny, so I am posting it below for your enjoyment.
Strings Help File:
Strings is a program that will assist you in all of your string needs. Strings has nine functions for working with strings. These are those functions:
[1] Input New String
[2] Length
[3] Uppercase
[4] Lowercase
[5] Count Characters
[6] Count English Words
[7] Substring
[8] Find Character
[9] Tokenize
Read the following sections to find out how to use each of these functions.
Note: You don't HAVE to input a string to use these functions. This is because the empty string is a valid string. But, the results will be boring, so please, start off with a string! Also, if you need to quit, press q when you are at the Choice: prompt. Have fun!
[1] Input New String
First, press i when at the Choice: prompt. Now you can put in any string you desire as long as it is shorter that 255 characters and it has no newlines in it. Once you press Return, you have told Strings that you are done inputting a string. Now that you have input a string, you can play with it! Try some of the other functions with your father watching!
[2] Length
Press l when at the Choice: prompt.
This is probably one of the most boring functions that exists. But despite it's lack of enthusiasm, it is still very useful. Example: what do you do if a criminal puts a gun to your head and says that if you do not know how long the word, "Supercalifragilisticexpialidocious" is, he will shoot you? I'll tell you what you do. You run. But on the off chance that he has you bound but near a computer, you use Strings.
[3] Uppercase
Press u when at the Choice: prompt.
Uppercase is great if you need to see what it will be like when you are shouting. For example, if your string is: "hey man, why is this room so hot?" It conveys a certain relaxed mood on your part. Uppercase will help you express your true feelings about how hot the room truly is, how much you really want to know, and how loud you are actually speaking.
[4] Lowercase
Press L when at the Choice: prompt.
Lowercase helps when other people are shouting, but you want to keep your cool. When a flamewar begins and someone says to you, "WOW YOU SURE KNOW A LOT ABOUT HOW TO PROGRAM IN FORTRAN!" it will surely come across as sarcastic. Just use the lowercase function to fix this and make them actually praise you for your knowledge of arcane and esoteric computer miscellany!
[5] Count Characters
Press c when at the Choice: prompt.
Now things are getting complicated. Count characters starts asking you questions the moment you summon it. You may think to yourself, "Woah, maybe this is a bad idea. Count characters could be a shady character himself!" Well, hold on now. Count Characters is like a close friend who refuses to give you false data, and will only answer your questions if you give him all the information for him to ponder. The only information this guy really wants is which character to count. So you know, just press the key of the character to count. Pretty useful actually.
[6] Count English Words
Press w when at the Choice: prompt.
This is one of the most sophisticated things that Strings can do, and most kindergartners can do it! It's helpful if you are like me though, and are no longer in kindergarten. Note: contractions count as one word, so if I say, "Daryl, don't you touch that poor rabbit!" that is only 7 words.
[7] Substring
Press s when at the Choice: prompt.
Substring is a little bit of a strange guy, but he's still good to keep around. He will start off by asking you where you want your substring to start. This is a pretty easy question. Just type a number, like 1 or something, and press enter. Then he will as you how long the substring should be. Again, just a number will be fine. Substring will give you part of your initial string. Substring is good for things like ransom letters where you need to chop up a bunch of other strings. Like I said, he's a weird guy, but you never know when you need him around.
[8] Find Character
Press f when at the Choice: prompt.
Find character is reminiscent of a helpful police officer. He will ask you a number of questions to discover who you want to find, and then based on that information, tell you exactly where the character is. To be more precise, he will first ask you who you want to find. Just press the button representing the character you want. He will then ask for the character's index. This just means that if there are more than one of them, which one. So for the string "frewfrew" there are two of each! So if you want the index of the second f, just press f, then 2, then Enter.
[9] Tokenize
Press t when at the Choice: prompt.
Tokenize is like a wise man who knows the difference between the wheat and the chaff. Tokenize will help you to find the strings inside of your strings that are useful to you. But HEY MAN! you have to give him some information! He isn't a mind reader! So, first he will ask you which characters you want to split around. This means that if you want to split around just : press : and then enter. But if you want to split around : and , press :, and he will split around both. He will then ask you for which Token you want. This is an integer representing which token you want. So for example, if our split characters are [,.:; ] and our string is [frew, why:don't:you;hang out with the bros. anymore?] then token 4 is don't. This may sound weird, but there is a token between , and the space. This make sense! What if tokenize had something like this: [frew:x:1000:100::/home/frew:/bin/zsh]. You wouldn't want to say that the 5th token is /home/frew! The 5th token is empty! So you know, tokenize is a wise and knowing fellow, but you have to know how to interpret what he says.
Also: I am going to be in Florida for the next few days, so if I don't post, that's why.