From 2806c7f863390fa6847809673d33d1a05e2c9a0e Mon Sep 17 00:00:00 2001 From: Matthias Felleisen Date: Wed, 23 Apr 2008 21:28:43 +0000 Subject: [PATCH] fx svn: r9437 --- collects/teachpack/htdp/Docs/guess.scrbl | 43 +++++++++++++++++++++ collects/teachpack/htdp/Docs/guess.thtml | 49 ------------------------ 2 files changed, 43 insertions(+), 49 deletions(-) create mode 100644 collects/teachpack/htdp/Docs/guess.scrbl delete mode 100644 collects/teachpack/htdp/Docs/guess.thtml diff --git a/collects/teachpack/htdp/Docs/guess.scrbl b/collects/teachpack/htdp/Docs/guess.scrbl new file mode 100644 index 0000000000..67a1361d12 --- /dev/null +++ b/collects/teachpack/htdp/Docs/guess.scrbl @@ -0,0 +1,43 @@ +#lang scribble/doc + +@(require scribble/manual + (for-label scheme + teachpack/htdp/guess)) + +@title[#:tag "guess"]{Guessing Numbers: guess.ss} + +@declare-exporting[teachpack/htdp/guess] + +The teachpack provides operations to play a guess-the-number game. Each +operation display a GUI in which a player can choose specific values for +some number of digits and then check the guess. The more advanced +operations ask students to implement more of the game. + +@defproc[(guess-with-gui [check-guess (-> number? number? symbol?)]) true]{ +The @scheme[check-guess] function consumes two numbers: @scheme[guess], which +is the user's guess, and @scheme[target], which is the randomly +chosen number-to-be-guessed. The result is a symbol that reflects the +relationship of the player's guess to the target.} + +@defproc[(guess-with-gui-3 [check-guess (-> digit? digit? digit? number? symbol?)]) true]{ +The @scheme[check-guess] function consumes three digits (@scheme[digit0], +@scheme[digit1], @scheme[digit2]) and one number (@scheme[target]). The +latter is the randomly chosen number-to-be-guessed; the three digits are +the current guess. The result is a symbol that reflects the relationship of +the player's guess (the digits converted to a number) to the target. + +Note: @scheme[digit0] is the @emph{least} significant digit that +the user chose and @scheme[digit2] is the @emph{most} significant +one.} + +@defproc[(guess-with-gui-list [check-guess (-> (list-of digit?) number? symbol?)]) true]{ +The @scheme[check-guess] function consumes a list of digits +(@scheme[digits]) and a number (@scheme[target]). The former is a list +that makes up the user's guess, and the latter is the randomly chosen +number-to-be-guessed. The result is a symbol that reflects the +relationship of the player's guess (the digits converted to a number) to +the target. + +Note: the first item on @scheme[digits] is the @emph{least} +significant digit that the user chose, and the last one is the +@emph{most} significant digit.} diff --git a/collects/teachpack/htdp/Docs/guess.thtml b/collects/teachpack/htdp/Docs/guess.thtml deleted file mode 100644 index 41ef3e8911..0000000000 --- a/collects/teachpack/htdp/Docs/guess.thtml +++ /dev/null @@ -1,49 +0,0 @@ -{ (define LIBNAME "Guess") - (include "head.tinc") } - -

The teachpack guess.ss provides operations to play a -guess-the-number game. Each operation display a GUI in which a player -can choose specific values for some number of digits and then check the -guess. The more advanced operations ask students to implement more of the -game.

- -

The teachpack provides three operations: -

-
  • {(idx guess-with-gui)} : check-guess -> true;
    - The check-guess function consumes two numbers: guess, which - is the user's guess, and target, which is the randomly - chosen number-to-be-guessed. The result is a symbol that reflects the - relationship of the player's guess to the target. -

    - -
  • {(idx guess-with-gui-3)} : check-guess -> true;
    - - The check-guess function consumes three digits and one number: - digit0, digit1, digit2, which make up the user's guess, and - target, which is the randomly chosen - number-to-be-guessed. The result is a symbol that reflects the - relationship of the player's guess (the digits converted to a number) to - the target. -

    - - Note: digit0 is the least significant digit that - the user chose and digit2 is the most significant - one. - -
  • {(idx guess-with-gui-list)} : check-guess -> true;
    - - The check-guess function consumes a list of digits and one number: - digits, a list that makes up the user's guess, and - target, which is the randomly chosen - number-to-be-guessed. The result is a symbol that reflects the - relationship of the player's guess (the digits converted to a number) to - the target. -

    - - Note: the first item on digits is the least - significant digit that the user chose, and the last one is the - most significant digit. - -
  • - -{(include "foot.tinc")}