From de8ba4b11adbec6ce5c02c6265df67a6da75d7fd Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Mon, 10 Jan 2011 17:12:22 -0600 Subject: [PATCH] improved the way scoring works for same --- collects/games/same/same.rkt | 13 ++++++++----- collects/games/scribblings/same.scrbl | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/collects/games/same/same.rkt b/collects/games/same/same.rkt index 6e14f476fc..b987ced73c 100644 --- a/collects/games/same/same.rkt +++ b/collects/games/same/same.rkt @@ -62,16 +62,19 @@ (set! clicked-score (+ clicked-score (* balls-going-away balls-going-away))) (set-score-label)) (define (set-score-label) - (define penalty 0) + (define cells-filled-in 0) (for ([v (in-vector board)]) (for ([v (in-vector v)]) (when (vector-ref v 0) - (set! penalty (+ penalty 10))))) + (set! cells-filled-in (+ cells-filled-in 1))))) + (define bonus (if (<= cells-filled-in 10) + (* 100 (- 10 cells-filled-in)) + 0)) (send score-message set-label - (format "~a - ~a = ~a" + (format "~a + ~a = ~a" clicked-score - penalty - (- clicked-score penalty)))) + bonus + (+ clicked-score bonus)))) (define same-canvas% diff --git a/collects/games/scribblings/same.scrbl b/collects/games/scribblings/same.scrbl index 6ea1beb19d..893cc7e587 100644 --- a/collects/games/scribblings/same.scrbl +++ b/collects/games/scribblings/same.scrbl @@ -11,10 +11,13 @@ new blobs as pieces of the old blobs fall down to fill in the empty space. If an entire column is wiped out, all of the blobs from the right will slide left to take up the empty column's space. -Your score increases for each ball removed from the board. In general, -when you remove a blob, you get as many points as the square of the number -of cells the blob occupied, so removing bigger blobs is better. Also, -there is a penalty of 10 points for each colored cell left behind on the board, -so try to clear out the entire board. +Your score increases for each ball removed from the board, in two ways. +First, when you remove a blob, you get as many points as the square of the number +of cells the blob occupied, so removing bigger blobs is better. Second, if there +are fewer than 10 cells occupied on the board, you get a bonus. +Specifically if you have 9 cells left, you +get a 100 point bonus, 8 cells left yields a 200 point bonus, +7 cells a 300 point bonus etc., and if there +are no cells left, you get a 1000 point bonus. Click the @onscreen{New Game} button to play again.