### How do we fix these errors?

321
views
0
4 months ago by

We don't know how to answer them.  We wonder if we are missing some parts, example: motion, etc.

modified 4 months ago by Chris Smith   • written 4 months ago by Alyssa Ann Dilan

0
4 months ago by

There are several things going on here.

The quickest problems to fix are in drawing the picture.  Your idea is fine, but you have a few careless errors here:

1. gray is a function, and needs a parameter saying which shade.
2.  It looks like you have two flags.  Shouldn't there be just one?
3. On both lines 31 and 32, your translated function is on the inside, so its x and y parameters need to come before the color that goes with the colored function.

There is a more fundamental problem in your step function.  Your step function needs a World as its parameter.  Instead, you've written it to receive just four numbers.  You'll need to break down your step into separate functions for each of the three parts of the World (the marble, ball, and flag).

modified 4 months ago by Chris Smith   • written 4 months ago by Chris Smith

one of the flags is for the pole (FlagF)

written 4 months ago by Alyssa Ann Dilan

You don't need a fourth piece of state for that. The flag pole doesn't change, so it doesn't have any state. You can just do this instead:

flag(f)   = colored(translated(solidRectangle(1,5),gray),7,-7) &
colored(translated(solidRectangle(1,4),green),6,-7)
written 4 months ago by Chris Smith