This page contains additional review exercises.
We will write a function to conjugate regular verbs “-ar” and “-er” verbs according to the following chart. Use the ending letters to decide how to categorize a given verb. We will only consider the present and past tense (preterit) of the verbs.
Verb | Subject | Past? | Result is base + | Example (“andar”/“correr”) |
---|---|---|---|---|
-ar | yo | false | -o | ando |
-ar | yo | true | -é | andé |
-ar | tu | false | -as | andas |
-ar | tu | true | -aste | andaste |
-er | yo | false | -o | corro |
-er | yo | true | -í | corrí |
-er | tu | false | -es | corres |
-er | tu | true | -iste | corriste |
Signature:
conjugar: string(verb-infinitive)
string(person)
boolean(past-tense?)
-> string
Example:
(check-expect (conjugar "correr" "tu" true)
"corriste")
Note: ignore accents.
Too much? Try the simplified, present tense only function:
Verb | Subject | Result is base + | Example (“andar”/“correr”) |
---|---|---|---|
-ar | yo | -o | ando |
-ar | tu | -as | andas |
-er | yo | -o | corro |
-er | tu | -es | corres |
An image-posn
is an image together with a posn.
draw-it: ip image(background) -> image
teleport: ip(shape1) ip(shape2) -> ip(new-shape1)
: Produce a new ip
whose image is the same as shape1
but whose position is the same as shape2
. This has the effect of moving shape1 on top of shape2.