On this page:
master

1.5 MasterMinding: "master.rkt"

 (require htdp/master)

The teachpack implements GUI for playing a simple master mind-like game, based on a function designed by a student. The player clicks on two colors and the program responds with an answer that indicates how many colors and places were correct.

procedure

(master check-guess)  symbol?

  check-guess : (-> symbol? symbol? symbol? symbol? boolean?)
Chooses two “secret” colors and then opens a graphical user interface for playing MasterMind. The player is prompted to choose two colors, via a choice tablet and mouse clicks. Once chosen, master uses check-guess to compare them.

If the two guesses completely match the two secret colors, check-guess must return 'PerfectGuess; otherwise it must return a different, informative symbol.