How do we fix these errors?

14 months ago by   <--------------- Link to program.


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

Please help!!!!!!

Community: CodeWorld

1 Answer

14 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).

one of the flags is for the pole (FlagF)

written 14 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) &
written 14 months ago by Chris Smith  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »