diff --git a/collects/games/chat-noir/chat-noir-literate.ss b/collects/games/chat-noir/chat-noir-literate.ss index 430a3df3fe..bb249256eb 100755 --- a/collects/games/chat-noir/chat-noir-literate.ss +++ b/collects/games/chat-noir/chat-noir-literate.ss @@ -5,27 +5,37 @@ ] The first main data definition for Chat Noir is the state of the world. +It consists of a structure with six fields: a @scheme[board], a +@scheme[posn] for the cat, the state of the game (@scheme[state] below), +a @scheme[posn] for the location of the mouse (or @scheme[#f] if the +mouse is not in the window), and a boolean indicating if the @tt{h} +key has been pushed down. @chunk[ (define-struct world (board cat state size mouse-posn h-down?) #:transparent) ] -;; a world is: -;; (make-world board posn state number mouse posn-or-false boolean) - - +@verbatim[#<<--- ;; a state is either: ;; - 'playing ;; - 'cat-won ;; - 'cat-lost +--- +] +@verbatim[#<<--- ;; a board is ;; (listof cell) +--- +] +@verbatim[#<<--- ;; a cell is ;; (make-cell (make-posn int[0-board-size] ;; int[0-board-size]) ;; boolean) +--- +] @chunk[ (define-struct cell (p blocked?) #:transparent)]