On this page:
<initial-world>
<go>
1.18.10 Run, program, run

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

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

  (define board-size 11)
  (define (make-initial-world)
    (define initial-board
      (add-n-random-blocked-cells
       6
       (empty-board board-size)
       board-size))
    (make-world initial-board
                      (make-posn (quotient board-size 2)
                                 (quotient board-size 2))
                      'playing
                      board-size
                      #f
                      #f))

Next, the game starts by calling big-bang with the appropriate arguments.

<go> ::=
  (void
   (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")))