Monday, June 17, 2017
When I was working on Pyret the computer fan was constantly running. I would have to debug it. I am using a different computer than I used last time, the computer that I am using has JavaScript and I think that is the cause of what is happening to the computer. So far when the computer is wrapping the plane. It wouldn't move. So the program is slowing down which means that the program is causing some issues the computer that I am using. So I will explain what you have to do next just I the last time I used.
We are doing to define the keystroke. We are going to move the plane by using the up and down key. When we press the up the plane would go faster and if we press down the plane would descend even faster. The constant of the plane of how much distance a key represents:
KEY-DISTANCE = 10
Know we define the function we would be alter’s the airplane’s position by that distance depending on which key is pressed:
When I was working on Pyret the computer fan was constantly running. I would have to debug it. I am using a different computer than I used last time, the computer that I am using has JavaScript and I think that is the cause of what is happening to the computer. So far when the computer is wrapping the plane. It wouldn't move. So the program is slowing down which means that the program is causing some issues the computer that I am using. So I will explain what you have to do next just I the last time I used.
We are doing to define the keystroke. We are going to move the plane by using the up and down key. When we press the up the plane would go faster and if we press down the plane would descend even faster. The constant of the plane of how much distance a key represents:
KEY-DISTANCE = 10
Know we define the function we would be alter’s the airplane’s position by that distance depending on which key is pressed:
| fun alter-airplane-y-on-key(w, key): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ask: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | key == "up" then: posn(w.x, w.y - KEY-DISTANCE) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | key == "down" then: posn(w.x, w.y + KEY-DISTANCE) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | otherwise: w | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| end | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| end Then we would have to enter what the key would mean
Would be writing the plane size function
Then we would tell Pyret to use this predicate to automatically halt
the animation by using this function:
|
Great post, Dayana! It is detailed and complete, and will give me what I need to look into the issues with your code. Unfortunately, I won't have time to do that until the end of the week. For the next two days, you could be most helpful working with Eric on the helios elections and testing Duncan's web scraping scripts.
ReplyDelete