{"size": 2042, "ext": "scrbl", "max_stars_repo_path": "htdp-doc/teachpack/htdp/scribblings/guess.scrbl", "max_stars_repo_name": "bdeket/htdp", "max_stars_repo_stars_event_min_datetime": "2015-01-14T20:28:41.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-20T04:04:26.000Z", "max_issues_repo_path": "htdp-doc/teachpack/htdp/scribblings/guess.scrbl", "max_issues_repo_name": "bdeket/htdp", "max_issues_repo_issues_event_min_datetime": "2015-01-14T19:50:21.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-19T21:38:00.000Z", "max_forks_repo_path": "htdp-doc/teachpack/htdp/scribblings/guess.scrbl", "max_forks_repo_name": "bdeket/htdp", "max_forks_repo_forks_event_min_datetime": "2015-01-14T19:11:38.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-24T05:11:39.000Z"}
{"max_stars_count": 85, "max_issues_count": 132, "max_forks_count": 81, "avg_line_length": 46.4090909091, "max_line_length": 90, "alphanum_fraction": 0.7590597453}
#lang scribble/doc

@(require scribble/manual "shared.rkt"
          (for-label racket teachpack/htdp/guess))

@teachpack["guess"]{Guessing Numbers}

@;declare-exporting[teachpack/htdp/guess]
@defmodule[#:require-form beginner-require htdp/guess]

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

@defproc[(guess-with-gui [check-guess (-> number? number? symbol?)]) true]{
The @racket[check-guess] function consumes two numbers: @racket[guess], which
is the user's guess, and @racket[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 @racket[check-guess] function consumes three digits (@racket[digit0],
@racket[digit1], @racket[digit2]) and one number (@racket[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: @racket[digit0] is the @emph{least} significant digit that
the user chose and @racket[digit2] is the @emph{most} significant
one.}

@defproc[(guess-with-gui-list [check-guess (-> (list-of digit?) number? symbol?)]) true]{
The @racket[check-guess] function consumes a list of digits
(@racket[digits]) and a number (@racket[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 @racket[digits] is the @emph{least}
significant digit that the user chose, and the last one is the
@emph{most} significant digit.}
