From ed9584be2a1e4cdfba4d047e7dc2d74b6dfe7297 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 13 Feb 2009 21:58:27 +0000 Subject: [PATCH] fixed test case issues svn: r13558 --- .../games/chat-noir/chat-noir-literate.ss | 56 +++++++++++-------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/collects/games/chat-noir/chat-noir-literate.ss b/collects/games/chat-noir/chat-noir-literate.ss index 7f0a651b66..430a3df3fe 100755 --- a/collects/games/chat-noir/chat-noir-literate.ss +++ b/collects/games/chat-noir/chat-noir-literate.ss @@ -1,10 +1,36 @@ #reader "literate-reader.ss" @chunk[
+ + ] -@chunk[ +The first main data definition for Chat Noir is the state of the world. -#;'() +@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) + + +;; a state is either: +;; - 'playing +;; - 'cat-won +;; - 'cat-lost + +;; a board is +;; (listof cell) + +;; a cell is +;; (make-cell (make-posn int[0-board-size] +;; int[0-board-size]) +;; boolean) +@chunk[ + (define-struct cell (p blocked?) #:transparent)] + + +@chunk[ (require htdp/world lang/posn) (define-syntax (check-expect stx) @@ -40,7 +66,12 @@ (define (make-immutable-hash/list-init [init '()]) (make-immutable-hash (map (λ (x) (cons (car x) (cadr x))) - init))) + init)))] + +@chunk[ + +#;'() + ;; constants (define circle-radius 20) @@ -51,25 +82,6 @@ (define blocked-color 'black) (define under-mouse-color 'black) -;; data definitions - -;; a world is: -;; (make-world board posn state number mouse posn-or-false boolean) -(define-struct world (board cat state size mouse-posn h-down?) #:transparent) - -;; a state is either: -;; - 'playing -;; - 'cat-won -;; - 'cat-lost - -;; a board is -;; (listof cell) - -;; a cell is -;; (make-cell (make-posn int[0-board-size] -;; int[0-board-size]) -;; boolean) -(define-struct cell (p blocked?) #:transparent) ;