Perl -Madlibs

Perl Program 3, Madlibs Madlibs is a word game involving short stories that are completed by a player. The player is told what kind of words to provide but not how they will be used in the story. The results are variously amusing, silly, or nonsensical. Here's an example. Story Template Strangeness in Cars I once owned a [noun] that was [adjective] only when in a [Make-of-car]. Some [plural-noun] thought, [adverb], that this was [another-adjective], but what did they [verb]. Anyway, now I am [comparative], and don't [verb] so much, even when in [make-of-car] cars. Do you think that's [another-adjective], or should I [strange-action-verb]? User Words The player must provide replacements for the words in square brackets. Here, the words are noun, adjective, make-of-car, plural-noun, adverb, another-adjective, verb, comparative, strange-action-verb. Note that if the same word appears twice in brackets, it represents only one word and the same substitution is made in all places that the word occurs. Suppose the player provides the following substitute words. noun => jar adjective => large make-of-car => REO plural-noun => combs adverb => lightly another-adjective => smaller verb => dance comparative => larger strange-action-verb => prance The resulting story would be. Strangeness in Cars I once owned a jar that was large only when in a REO. Some combs thought, lightly, that this was smaller, but what did they dance. Anyway, now I am larger, and don't dance so much, even when in REO cars. Do you think that's smaller, or should I prance? You'll find many more examples of madlibs on this link. There are two template files, "Strangeness of Cars" and "Vacation" that you can use for testing. Create another of your own design.

## Deliverables

Deliverables: The program Create a Perl script to play madlibs. Call it madlibs.pl. The script should be designed to run with one command line parameter providing the name of the story template file. Under Unix, you could then give the command $ [url removed, login to view] [url removed, login to view] to use the [url removed, login to view] story template. The program should prompt the user for each replacement word and build a hash of the resulting word pairs. The brackets are for you to identify what to replace but should not be shown to the user. After you have all the replacements, print the resulting story using the same line arrangement as in the original template. Your code must include at least two user functions. At least one function must have arguments that are copied into variables. You must use pattern matching with substitution to extract the words to replace and to do the replacement. You may not use the substr() function. Five Point Bonus: If the bracketed word starts with an upper-case letter, print the replacement with the first letter upper-case even if the user types the replacement with a lower-case letter but do not change an initial upper-case letter to lower case. If the same word is used two or more times, capitalize it only when the word in the template is capitalized. This must be implemented using pattern matching and substitution commands. What to turn in Submit your program script file, [url removed, login to view], both on paper and electronically using hwroy. Submit a sample of the program execution on paper only

## Platform

Windows XP Perl

Evner: Ingeniørarbejde, Microsoft, MySQL, Perl, PHP, Software Arkitektur, Software Testning, Windows Skrivebord

Se mere: word find template, windows action script, strange design, on line cars, i will dance for you, find unix, find perl, design your own case, command design pattern, change jar, 4 letter action word, 42 design square, what is perl used for, how to make a short story, make your own game, design your own car game, design your own car, create your own game, create a car game, car design program

Om arbejdsgiveren:
( 13 bedømmelser ) United States

Projekt ID: #2909187

Tildelt til:


See private message.

$17 USD in 14 dage
(10 bedømmelser)

3 freelancere byder i gennemsnit $16 på dette job


See private message.

$15.3 USD in 14 dage
(175 bedømmelser)

See private message.

$17 USD in 14 dage
(0 bedømmelser)