Lab 4β£.0β£ Lists
October 21, 2016Create a variable for each part of speech below, and set each variable to hold a list of words that fit that part of speech. Some examples are given, but feel free to use your own.
Part of Speech | Definition | Example Words |
---|---|---|
noun | person, place, or thing | giraffe, monkey, boy, girl, elephant, β¦ peopleβs namesβ¦ |
verb | action word | jumps, runs, sleeps, sits, dances, β¦ |
adjective | describes a noun | big, small, loud, silly, young, old, sleepy, β¦ |
adverb | describes a verb or an adjective | quickly, excitedly, angrily, happily, sadly, β¦ |
article | introduces noun: the book, a giraffe | a, the |
preposition | relates a noun to something else | under, over, around, near, beside, β¦ |
Write a custom reporter block called βnoun phraseβ that reports a noun phrase where each word is chosen randomly from the lists you created. A noun phrase consists of an article, an adjective, and a noun in that order.
Write custom reporter blocks like noun phrase
for each of the phrase types listed below.
Block name | Construction |
---|---|
prepositional phrase | preposition, noun phrase |
verb phrase | adverb, verb, preposition phrase |
sentence phrase | noun phrase, verb phrase |
Write code so that when you press the spacebar, a random sentence is generated and a sprite says a sentence.
Changing Our Vocabulary
- Write a script so that when the βnβ key is pressed, the user is prompted for a new noun and that noun is added to list of nouns. After that point, the new noun entered by the user should be able to appear in sentences.
- Write scripts to add words to the other lists. Use the keys listed below.
Key | Part of speech |
---|---|
v | verb |
j | adjective |
d | adverb |
a | article |
p | preposition |