### Mastermind Puzzle Generator

For details see Wikipedia entry on mastermind game.

For more puzzles and free mastermind source code in C and pascal.

Puzzle: guess the 4 hidden pegs, numbered 1..6

Hints:

B: a correct pin in correct position.

W: a correct pin in wrong position.

problem 1 {

1, -2245-BB---

2, -1652-W----

3, -3131------

4, -1334-W----

5, -4516-WW---

}

problem 2 {

1, -4134-B----

2, -4242-BW---

3, -2434-BB---

4, -5622-BW---

}

problem 3 {

1, -1356-W----

2, -5426-WW---

3, -6561-B----

4, -2442-BW---

5, -5352-WB---

}

problem 4 {

1, -5522-B----

2, -6131-W----

3, -3126-W----

4, -3131------

5, -3643-WW---

6, -2542-WW---

}

problem 5 {

1, -1635-WW---

2, -4242-B----

3, -2241-W----

4, -2542-W----

5, -2466-BW---

}

problem 6 {

1, -6451-WW---

2, -3611-BB---

3, -6124-W----

4, -3365-BB---

}

problem 7 {

1, -6613-WW---

2, -1452-BBW--

3, -3335-BW---

4, -6631-WW---

5, -2352-BBW--

}

problem 8 {

1, -2553-BB---

2, -5352-WW---

3, -2412-BB---

4, -5256-W----

5, -4162-WW---

6, -6631-BWW--

}

problem 9 {

1, -3331------

2, -3334------

3, -2253-WW---

4, -1322-B----

5, -1554-B----

6, -2416-WW---

}

problem 10 {

1, -6122-WW---

2, -1264-WW---

3, -1551-W----

4, -4431-WW---

5, -2464-W----

6, -5621-BW---

7, -2463-BW---

}

Solutions to Mastermind Puzzles above.

(numbers indicate how many choices at each step)

solution 1: -5445------ (105 19 6 4 1 )

solution 2: -2332------ (182 21 6 1 )

solution 3: -4544------ (152 32 7 2 1 )

solution 4: -5464------ (256 38 11 4 2 1 )

solution 5: -4363------ (312 60 14 2 1 )

solution 6: -3515------ (312 19 5 1 )

solution 7: -3152------ (222 10 4 2 1 )

solution 8: -2433------ (105 48 7 3 2 1 )

solution 9: -6562------ (256 81 11 10 2 1 )

solution 10: -3613------ (222 36 5 4 3 2 1 )