From a354195ae4b43bbdaf77f667022c356f60238712 Mon Sep 17 00:00:00 2001 From: Matthias Felleisen Date: Fri, 21 Dec 2012 20:11:58 -0500 Subject: [PATCH] purpose statements --- collects/realm/chapter2/source.rkt | 35 +++++++++++++++++++----------- collects/realm/chapter5/source.rkt | 28 +++++++++++++++--------- collects/realm/chapter6/source.rkt | 17 ++++++++++----- collects/realm/chapter8/source.rkt | 6 ++--- 4 files changed, 54 insertions(+), 32 deletions(-) diff --git a/collects/realm/chapter2/source.rkt b/collects/realm/chapter2/source.rkt index aa08e37539..64d51841f8 100644 --- a/collects/realm/chapter2/source.rkt +++ b/collects/realm/chapter2/source.rkt @@ -1,19 +1,26 @@ #lang racket -(require rackunit rackunit/text-ui) +#| + The Guess My Number game, played at DrRacket's REPL + --------------------------------------------------- + + You pick a number. The program guesses the nunber, + by asking you questions. Your responses are "too + small" "too large" or "you uessed it". -;; Play a Guess my Number game at the REPL. -;; Run program. -;; Pick a number X between and . -;; Evaluate -;; (start ) -;; The program will respond with a number. -;; Use -;; (bigger) -;; and -;; (smaller) -;; to let it know what you think of the guess. -;; Watch how qiuckly the program guesses X. + Play + ---- + + Click Run. Pick a number X between and . + Evaluate + (start ) + The program will respond with a number. + Use + (bigger) + and + (smaller) + to let it know what you think of its guess. +|# ; ; @@ -102,6 +109,8 @@ (module+ test + (require rackunit rackunit/text-ui) + ;; basic guesses (check-equal? (guess) 50) diff --git a/collects/realm/chapter5/source.rkt b/collects/realm/chapter5/source.rkt index 14a8579374..c880749e2a 100644 --- a/collects/realm/chapter5/source.rkt +++ b/collects/realm/chapter5/source.rkt @@ -1,17 +1,23 @@ #lang racket -;; ----------------------------------------------------------------------------- -;; Play a "Guess my Number" game with a GUI. +#| + The Guess My Number game, with a simple graphical user interface (GUI) + ---------------------------------------------------------------------- + + You pick a number. The program guesses the nunber, + by asking you questions. Your responses are "too + small" "too large" or "you uessed it". -(require rackunit rackunit/text-ui 2htdp/image 2htdp/universe) + Play + ---- -;; Play a Guess my Number game at the REPL. -;; Run program. -;; Pick a number X between and . -;; Evaluate -;; (start ) -;; This will pop up a window with instructions for interacting with the program. -;; Watch how qiuckly the program guesses X. + Click Run. Pick a number X between and . + Evaluate + (start ) + This will pop up a window with instructions for interacting with the program. +|# + +(require 2htdp/image 2htdp/universe) ; ; @@ -190,6 +196,8 @@ (module+ test + (require rackunit rackunit/text-ui) + ;; testing the 'model' functions for basic guesses (check-true (single? (interval 50 50))) diff --git a/collects/realm/chapter6/source.rkt b/collects/realm/chapter6/source.rkt index 35d03bc661..90c2fd455c 100644 --- a/collects/realm/chapter6/source.rkt +++ b/collects/realm/chapter6/source.rkt @@ -1,6 +1,9 @@ #lang racket #| + The Snake game + -------------- + The Snake game revolves around a room filled with pieces of radioactive goo and a snake that can remove this goo. @@ -13,13 +16,15 @@ the four arrow keys. When the snake gets close to a piece of goo, it eats the goo and grows a new segment. If the snake runs into itself or one of the four walls, the game is over. The length of the snake is the player's score. -|# -;; Play a Snake game. -;; Run program and evaluate -;; (start-snake) -;; This will pop up a window with instructions for interacting with the program. -;; Watch how qiuckly the program guesses X. + Play + ---- + + Run and evaluate + (start-snake) + This will pop up a window with instructions for interacting with the program. + Watch how qiuckly the program guesses X. +|# ; ; diff --git a/collects/realm/chapter8/source.rkt b/collects/realm/chapter8/source.rkt index 6a0b910bbd..831b572a82 100644 --- a/collects/realm/chapter8/source.rkt +++ b/collects/realm/chapter8/source.rkt @@ -26,10 +26,10 @@ Finally, "n" starts a new game. - Play a Orc game - ----------------- + Play + ---- - Run program and evaluate + Run and evaluate (start-game) This will pop up a window that displays the player's vitals, the orcs and their basic state, and the game instructions.