From 2b17f505e51f241d3744d77479bc3ba8c879a48b Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Tue, 18 Nov 2008 13:45:13 +0000 Subject: [PATCH] svn: r12487 --- collects/games/chat-noir/chat-noir.ss | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/collects/games/chat-noir/chat-noir.ss b/collects/games/chat-noir/chat-noir.ss index ff389fc9e9..af8c67309a 100644 --- a/collects/games/chat-noir/chat-noir.ss +++ b/collects/games/chat-noir/chat-noir.ss @@ -1,14 +1,9 @@ -#| - -hint: include the size of the board in your world structure -This enables you to make test cases with different size boards, -making some of the test cases much easier to manage. - -|# - +;; constants (define circle-radius 20) (define circle-spacing 22) +;; data definitions + ;; a world is: ;; (make-world board posn state number) (define-struct world (board cat state size)) @@ -138,21 +133,20 @@ making some of the test cases much easier to manage. ;; board->image : board number -> image (define (board->image cs world-size) - (foldl overlay + (foldl (lambda (x y) (overlay y x)) (nw:rectangle (world-width world-size) (world-height world-size) - 'outline - 'black) + 'solid + 'white) (map cell->image cs))) (check-expect (board->image (list (make-cell (make-posn 0 0) false)) 3) (overlay - (cell->image - (make-cell (make-posn 0 0) false)) (nw:rectangle (world-width 3) (world-height 3) - 'outline - 'black))) + 'solid + 'white) + (cell->image (make-cell (make-posn 0 0) false)))) ;; cell->image : cell -> image