How to solve the “Mastermind” guessing game?

后端 未结 10 461
有刺的猬
有刺的猬 2020-12-04 07:42

How would you create an algorithm to solve the following puzzle, \"Mastermind\"?

Your opponent has chosen four different colours from a set of six (yellow, blue, gre

10条回答
  •  我在风中等你
    2020-12-04 08:45

    There is a great site about MasterMind strategy here. The author starts off with very simple MasterMind problems (using numbers rather than letters, and ignoring order and repetition) and gradually builds up to a full MasterMind problem (using colours, which can be repeated, in any order, even with the possibility of errors in the clues).

    The seven tutorials that are presented are as follows:

    • Tutorial 1 - The simplest game setting (no errors, fixed order, no repetition)
    • Tutorial 2 - Code may contain blank spaces (no errors, fixed order, no repetition)
    • Tutorial 3 - Hints may contain errors (fixed order, no repetition)
    • Tutorial 4 - Game started from the middle (no errors, fixed order, no repetition)
    • Tutorial 5 - Digits / colours may be repeated (no errors, fixed order, each colour repeated at most 4 times)
    • Tutorial 6 - Digits / colours arranged in random order (no errors, random order, no repetition)
    • Tutorial 7 - Putting it all together (no errors, random order, each colour repeated at most 4 times)

提交回复
热议问题