Big Picture Questions
These questions focus on parts of the universe system that people have worked to understand.
-
How do you send a message?
-
How do you change your own world’s color and at the same time send a message telling world 4 your old color? Be clear about the sending process.
-
World1 sends world2 the message
(list 1 2 "lunch"). In what world(s) does the receive handler run? -
Should the receive handler check who the message is to? Why or why not?
-
World 3 “orange” receives a message from 2 to 3 “blue”. How can the receive handler in World 3 change the color of World 2 to “orange”?
-
What do you think of this plan? The universe server sends a message to world 6 telling its key handler to change the model to blue next time it runs.
-
The mouse handler in World 3 sends a message by returning:
(make-package world3 "green")When world 7’s receive handler
rhruns, what inputs does it receive? Explain which of these is correct.a. (rh world3 "green") b. (rh world7 "green") c. Neither of those -
The universe server sends every message to everyone. How does a world know a message is for it specifically?
-
You want 21 different computers (worlds) to join your server. They use the following ID numbers:
1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,6- How many windows open up if you simulate this setup on one
computer with
launch-many-worlds? - A message goes out “world 2 change to green”. How many worlds change color?
- A message goes out “world 6 change to purple”. How many worlds change color?
- How many windows open up if you simulate this setup on one
computer with
-
Do you have to include a “from” field in your message?
-
Why would you want to include a “from” field?
-
True/False. Explain.
- It is a good idea to put the
define-structfor the message at the start of the file. - “Fake struct” functions are required to make your messages work.
- It is a good idea to put the
-
Why is this wrong? Look for more than one issue.
(big-bang (make-state 1 "blue") (on-recieve rh) (on-key kh) (to-draw dh)) -
After the “D” key is hit, world 8 tells world 9 to change its color to “sky blue”. How does that change happen? Trace the action from hitting the key onward.
-
Below is an error someone encountered. Can you figure out what it is from?
make-package: expects a sexp as second argument, given (make-message 5 -1 "light orange")
Context for AI
Answer these questions using Racket with the universe teachpack. The server code just takes every message it receives and broadcasts it out to every world connected to the server. We are not studying the server, so do not mention any further details about how the server works.