Universe Resources

This page contains only the bare-bones information.

  • Generic server (see attachment).
  • (make-package model message) to update model and send a message.
  • A main function start-big-bang to launch the windows.

    (define (start-big-bang my-name initial-model)
      (big-bang initial-model
        (on-draw draw-h)
        (on-receive receive-h)
        (on-key key-h)
    
        (register LOCALHOST)
        (name my-name)
        (close-on-stop true)))
  • The launch-many-worlds command to quickly and easily start several windows.

    (launch-many-worlds
        (start-big-bang "whale" (make-model "blue" "gray"))
        (start-big-bang "squirrel" (make-model "red" "yellow")))

Sending Posns

You cannot send posns without a hack. The hack is to make a separate file that contains a little bit of lower level Racket code and require it. This code could go in your posn-util.rkt file! You need to use Racket mode, not Beginning Student.

    #lang racket
    (provide (all-defined-out))
    (define-struct posn (x y) #:prefab)

Additional Resources