Upcoming SlideShare
×

# Problem set8

395 views

Published on

Problem Set 8 for CS1120 at UVA

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
395
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
4
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Problem set8

1. 1. Mad Libs for Learning Problem Set 8 Caroline Mattey
2. 2. Target Audience <ul><li>This game is made for sixth graders who are learning about the grammar of the English language. This card game will teach them about replacement grammars and how they apply to grammar in English. </li></ul>
3. 3. Goal: <ul><li>The goal of the game is to create a proper sentence and be able to end your sentence by finding a period first. This is made more difficult in that there is a proportionally higher number of conjunctions that force you to start a new clause and a proportionally lower number of periods to draw when drawing a MoreClauses card after you have finished a clause. You will be given a point for every turn you must take, so you try to finish your sentence by replacing the nonterminals in proper order fastest. The person with the lower number of points at the end wins. </li></ul>
4. 4. Set Up: <ul><li>We will run a simulation of the game as the rules are given to explain how it would work. Note: if you were actually playing the game, you would take turns back and forth, but for the purposes of this simulation we will show the results of each rule comparing the two players so it’s easier to follow. </li></ul><ul><li>This is a simplified version of the real replacement grammar for the English language that only contains subjects, verbs, objects, prepositions, conjunctions, and adjectives. </li></ul><ul><li>There are three stacks of cards: Clause cards which are purple, MoreClauses cards which are blue, and Terminals which are pink and contain all of the possible subjects, verbs, objects, adjectives, prepositions, and conjunctions. </li></ul>
5. 5. Replacement Grammars <ul><li>In a replacement grammar there is a thing called a nonterminal on the left side of a ::=> symbol. On the right side of the symbol, there can either be more nonterminals or a terminal. The right side of the replacement rule is what you can replace the left side’s nonterminal with. Many nonterminals have different options as to what they can be replaced with. </li></ul><ul><li>All nonterminals can and should be replaced when creating a string in the language. Nonterminals can either be replaced with other nonterminals or terminals. Terminals cannot be replaced. </li></ul><ul><li>In this game, the nonterminals are Sentence, Clause, MoreClauses, Subject, Verb, Object, Adjective, Preposition, and Conjunction. The terminals are the examples of words that fit under the subject, verb, object, adjective, preposition, and conjunction categories. </li></ul>
6. 6. Replacement Grammar <ul><li>Sentence ::=> Clause MoreClauses </li></ul><ul><li>Clause::=> Subject Verb Object </li></ul><ul><li>Clause::=> Subject Verb Adjective Object </li></ul><ul><li>Clause::=> Subject Verb Preposition Object </li></ul><ul><li>MoreClauses::=> Conjunction Clause MoreClauses </li></ul><ul><li>MoreClauses::=> E (in this game “empty” will be represented by a period to end the sentence) </li></ul>
7. 7. Replacement Grammars <ul><li>A string is created when there are no nonterminals remaining, which will be represented by the addition of a period which terminates the string. </li></ul><ul><li>The nonterminal MoreClauses in the replacement grammar Sentence::=> Clause MoreClauses is what allows the language to create infinitely long strings. MoreClauses can either be replaced with a period, thus terminating the sentence, or it can be replaced with a conjunction, clause, and another MoreClauses. Embedding MoreClauses into the replacement grammar of MoreClauses makes this recursive. Because it is recursive, it can loop back on itself an infinite number of times creating longer and longer sentences until it finally terminates with a period. </li></ul>
8. 8. Replacement Grammar Continued.. <ul><li>Subject::=> Barack Obama/ Dimitry Medvedev/ David Cameron/ The Doctor/ Mike London </li></ul><ul><li>Verb::=> dances/ eats/ itches/ encourages/ destroys/ helps/ offends/ hunts/ opens/ jumps/ bounces/ judges </li></ul><ul><li>Object::=> puppies/ chicken sandwiches/ laptops/ Ford Pintos/ footballs/ pencils/ tv remotes/ TARDIS </li></ul><ul><li>Adjective::=> bizarre/ dramatic/ cool/ nervous/ perfect/ rare/ smelly/ tacky/ wonderful/ jolly/ political/ hungry </li></ul><ul><li>Conjunction::=> and/but </li></ul><ul><li>Preposition::=> with/ to/ from/ above/ around/ toward/ via </li></ul>
9. 9. Rule #1: Each player will start with a “Sentence::=> Clause MoreClauses” card. They will then draw a Clause card. The options include, Subject Verb Object, Subject Verb Adjective Object, and Subject Verb Preposition Object. <ul><li>Bobby draws a starting clause card. </li></ul><ul><li>Jane draws a starting clause card. </li></ul>Clause Subject Verb Adjective Object Clause Subject Verb Preposition Object
10. 10. Rule #2: Each player draws a card. If they don’t draw a subject card (the first nonterminal in their clause card they need to replace) they wait another turn. This continues until they draw a subject card. <ul><li>Bobby draws a subject card. </li></ul><ul><li>Jane draws a verb card. On her next turn, she draws a subject card. </li></ul>Subject Barack Obama Subject Mike London
11. 11. Rule #3: Each player draws a card. If they don’t draw a verb card (the next nonterminal in their clause card they need to replace) they wait until their next turn and draw again. This continues until they draw a verb card. <ul><li>Bobby draws an adjective card. On his next turn, he draws a subject card. On his next turn, he draws a verb card. </li></ul><ul><li>Jane draws a preposition card. On her next turn, she draws a verb card. </li></ul>Verb judges Verb bounces
12. 12. Rule #4: Each player draws a card. If Bobby doesn’t draw an adjective or Jane doesn’t draw a preposition card (the next nonterminal in their clause card they need to replace) they draw again on their next turn. This continues until they draw this card. <ul><li>Bobby draws an verb card. On his next turn, he draws an adjective card. </li></ul><ul><li>Jane draws a subject card. On her next turn, she draws a subject card again. On her next turn, she draws an object card. On her next turn, she draws a preposition card. </li></ul>Preposition with Adjective rare
13. 13. Rule #5: Each player draws a card. If they don’t draw an object card (the next nonterminal in their clause card they need to replace) they draw again on their next turn. This continues until they draw this card. <ul><li>Bobby draws an object card. </li></ul><ul><li>Jane draws a conjunction card. On her next turn, she draws a verb card. On her next turn, she draws an object card. </li></ul>Object pencils Object Chicken sandwiches
14. 14. Rule #6: Once a player has finished replacing the nonterminals from his/her clause card, they must draw another card from the MoreClauses stack. If they draw a period they have finished or they will draw a Conjunction Clause MoreClauses card and have to keep going. <ul><li>Bobby draws Conjunction Clause MoreClauses from the MoreClauses stack. </li></ul><ul><li>Jane draws a period. </li></ul>MoreClauses Conjunction Clause MoreClauses MoreClauses .
15. 15. Rule #7: If they draw a Conjunction Clause MoreClauses Card, they must then draw a conjunction to replace the first nonterminal. <ul><li>Bobby draws a subject card. On his next turn, he draws an object card. On his next turn, he draws a conjunction card. </li></ul><ul><li>Since Jane drew a period, she is finished! This is her final sentence. </li></ul>Mike London bounces with pencils. Conjunction and
16. 16. Rule #8: Once a player has drawn a MoreClauses card that requires a new clause to be formed and has drawn their conjunction, they draw a new Clause card from the clause card stack. <ul><li>Bobby draws a new clause card. </li></ul>Clause Subject Verb Object
17. 17. Rule #9: Once a player has drawn a new clause card, they must procede to follow rules #2-7. <ul><li>Bobby draws a subject card after 4 turns. </li></ul><ul><li>Bobby draws a verb card after a turn. </li></ul><ul><li>Bobby draws an object card after 2 turns. </li></ul><ul><li>Bobby draws a period from the MoreClauses stack. He is finished! His final sentence is… </li></ul>Subject David Cameron Verb helps Object Ford Pintos Barack Obama judges rare chicken sandwiches, and David Cameron helps Ford Pintos.
18. 18. Scoring: <ul><li>After counting up each number of turns each player has taken…. </li></ul><ul><li>Bobby: 21 points (it took him 21 draws to finish) </li></ul><ul><li>Jane: 13 points (it took her 13 draws to finish) </li></ul><ul><li>Jane wins! </li></ul>