02 Message
The message structure gets its name abbreviated to “ic-msg” because we type it a lot.
A IC-Msg
is a structure.
(make-ic-msg Number Number Color-String)
Interpretation:
(make-ic-msg from to col)
from
: the id of the world sending the messageto
: the id of the world the message is intended forcol
: the new color that world is to show
Instructions
-
Change a new file to Racket language mode, so it says “Determine language from source” at the bottom.
-
The file should contain only these three lines below:
#lang racket
(provide (all-defined-out))
(define-struct ic-msg (from to col) #:prefab)
Verify that the file says “Determine language from source” after saving!!
Common Problems
- The file must be in Racket language mode. (Menu: Language -> Choose Language … -> The Racket Language)
- There should be no space between the
#:
andprefab
.
If you have problems creating the file yourself, download it using Save link as… (ic-msg.rkt).
Last modified April 21, 2022: Very detailed walkthrough of a client-server project. (bed8711)