On this page:
<initial-world>
<go>
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
    (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))

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)
  (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"))))