Question: dr racket Question : Design a simulation using Dr Racket big-bang environment and ensure that your pro- grams are fully documented, using comments. Define a

dr racket
dr racket Question : Design a simulation using Dr Racket big-bang environment

Question : Design a simulation using Dr Racket big-bang environment and ensure that your pro- grams are fully documented, using comments. Define a structure named shape which has three fields: size is the size of shape ; color is color of shape pos is a posn structure and gives the location of shape keyEvent can be one of the following: zo for orange ir for red :p for pink b for blue ig for green 1. (25 points) Design tick-f function which takes list-of-shapes and produces a list-of-shapes. The function add the y position of shapes by one. 2. (25 points) Design key-f function which takes list-of-shapes and keyEvent and produces a list-of-shapes. The function checks the key event. If key event is; ;o then add a new orange shape with random size (SIZE) and random position where x is between (0.W) and y is between 0.H] to the list-of-shapes. I then add a new red shape with random size (SIZE) and random position where x is between [0,W) and y is between 0,H) to the list-of-shapes. p then add a new pink shape with random size (SIZE) and random position where x is between (0,W) and y is between 0,H) to the list-of-shapes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!