On this page:
1.18.10 Run, program, run🔗

This section contains expressions that start the Chat Noir game going.

First, here is a function to compute the state of the world at the start of a game.

(define board-size 11)
(define (make-initial-world)
  (define initial-board
     (empty-board board-size)
  (make-world initial-board
              (make-posn (quotient board-size 2)
                         (quotient board-size 2))

Finally, we can define and provide a function to start the game by calling big-bang with the appropriate arguments.

<go> ::=
(provide main)
(define (main)
   (big-bang (make-initial-world)
             (on-draw render-world
                      (world-width board-size)
                      (world-height board-size))
             (on-key change)
             (on-mouse clack)
             (name "Chat Noir"))))