Hacker Code?Back to indexThe first thing you see in the sample program down below is a variable called SUBS which is initialized with a long list of pairs of values. As the name SUBS implies this is a list of items that get substituted for each other. The part of the program which performs the actual substitution is the function called encode_message. Inspect the code below and get it up and running. We'll do a play-by-play analysis once you've had a chance to play with it a little. ASSIGNMENT: In the old days secretaries had to be good at dictation which required the use of shorthand. Nowadays this skill is not all that useful, largely because of the availability of recording devices. Be that as it may, shorthand is very easy to understand. Basically all you do is drop all vowels. So, for a list of vowels (a,e,i,o,u), a "" is substituted. Thus, The sun was hot and the wind was dry. becomes Th sn ws ht nd th wnd ws dr Alter the sample program so that it converts a message to shorthand. Delete all unnecessary lines of code. Do the actual conversion in a function called shorthand(). |