Author | Message |
---|---|
Amedrano
Posts: 80
|
Posted 21:38 Oct 23, 2015 |
here is my function (define (at-bottom? y-pos-pair) here is my error ball-y-pos: contract violation when i run "(my-animate ballList create-scene up-and-down at-bottom?)" the picture of 2 balls shows up but I get this error and they stay at their starting locations. Any tips?
|
jasonmz
Posts: 7
|
Posted 21:48 Oct 23, 2015 |
What does your up-and-down look like? That's the error I had when I first did it but then I rewrote it based off what Professor Abbott said here http://csns.calstatela.edu/department/cs/forum/topic/view?id=5185224:
|
rabbott
Posts: 1649
|
Posted 21:50 Oct 23, 2015 |
A couple of tips. 1. Add spaces to your code so that it's easier to read. 2. Describe what you intend the world state to be. Is it a list of two numbers? A list of two balls? Something else? Given what you expect it to be are you processing it consistent with that plan? Last edited by rabbott at
21:53 Oct 23, 2015.
|
Amedrano
Posts: 80
|
Posted 21:51 Oct 23, 2015 |
(define (up-and-down y-pos-pair) |
jasonmz
Posts: 7
|
Posted 21:57 Oct 23, 2015 |
You might want to try the debug and see what function is causing the change. For me it was in my up-and-down function, but I had changed what the function looked like compared to what Professor Abbott put up on the wiki. |
Amedrano
Posts: 80
|
Posted 21:57 Oct 23, 2015 |
Ok thanks :) |
shewitt2
Posts: 5
|
Posted 20:58 Oct 24, 2015 |
(define (up-and-down y-pos-pair)
I see a small problem with this. It appears like you're passing in as a parameter a pair of balls (which I'm assuming is in the form of a list, since a cons pair would throw a contract violation at (first y-pos-pair)), but you're returning a list of numbers. Big bang does something like this: draw(state) -> update(state) -> done?(state) If the state changes type in the update stage, no wonder it throws an exception in the done? stage. |