{"size": 1953, "ext": "scrbl", "max_stars_repo_path": "scribblings/wordle-solver.scrbl", "max_stars_repo_name": "Metaxal/wordle-solver", "max_stars_repo_stars_event_min_datetime": "2022-02-06T20:04:53.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-07T12:05:09.000Z", "max_issues_repo_path": "scribblings/wordle-solver.scrbl", "max_issues_repo_name": "Metaxal/wordle-solver", "max_issues_repo_issues_event_min_datetime": "2022-02-11T09:34:38.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-11T09:34:38.000Z", "max_forks_repo_path": "scribblings/wordle-solver.scrbl", "max_forks_repo_name": "Metaxal/wordle-solver", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 5, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 35.5090909091, "max_line_length": 98, "alphanum_fraction": 0.6154633897}
#lang scribble/manual
@(require racket/list
          racket/port
          (for-syntax racket/base)
          (for-label racket/contract/base
                     racket/base
                     wordle-solver
                     global)
          wordle-solver)

@title{Wordle solver: A simple greedy solver for Wordle}

See the @hyperlink["https://github.com/Metaxal/wordle-solver/blob/master/README.md"]{README} for a
quick start and usage examples.

@defmodule[wordle-solver]

@bold{Note:} The interface might change in the future. The documentation below describes only a
subset of the exported forms.

@defproc[(guess? [x any/c]) boolean/c]{A 5-letter word with only alphabetic characters.}
@defproc[(clue/int? [x any/c]) boolean/c]{A number between 0 and 243 (=3⁵).}
@defproc[(history? [x any/c]) boolean/c]{
Returns @racket[#true] if @racket[x] matches @racket[(listof (list/c guess? clue/int?))]}

@defproc[(play [target guess?]
               [goals (listof guess?)]
               [all-words (listof guess?)]
               [#:history-hash history-hash hash? (make-hash)])
         history?]{
The main function to play a game, either with user interaction or automatically.
Its behaviour depends on several globals described below.
@racket[all-words] must be a superset of @racket[goals], and @racket[target] must be a member of
 @racket[goals].
}


@defthing*[([*first-word* global?]
            [*auto?* global?]
            [*silent?* global?]
            [*squares?* global?]
            [*hard-mode?* global?]
            [*consistent-only?* global?]
            [*share-social?* global?]
            )]{
The globals are also used as command line arguments.
@verbatim|{racket -l- wordle-solver --help}| outputs:
@(verbatim
  (with-output-to-string
   (λ ()
     (let/ec return
       (parameterize ([current-command-line-arguments #("--help")]
                      [exit-handler (λ (v) (return v))])
         (main #:play play))))))}
