# ForthMastermind

Mastermind implementation in Forth. Source code available here.

### Usage

• Enter init to generate a new solution and then play.
• Put numbers on the stack and then enter ?? to test the solution. Outputs number of correct colors (col) and correct color on correct position (pos) as well as the tries so far.
• Use shittyknuth if you’re to dense to solve it on your own. This runs an inefficient version of Knuth’s mastermind algorithm and outputs the solution.
• If you’re in time trouble use greatknuth instead as it’s much faster!

#### Example usage

init
0 2 3 1 ??
0 4 2 0 ??
shittyknuth
." Look mommy, I solved it!" cr
." Hurry up Jimmy, grandma is waiting!" cr
init
greatknuth
." I solved it even faster this time!" cr


### Further Notes

• Number of possible colors (decoded as colors starting from 0) and fields (number of pins to guess) can be set to whatever you want. We recommend to stay below 7 fields though - it soon gets slow.
• This note is here to justify the plural in the title of this section.