策划者 这是一个小型演示应用程序,用于说明如何将与应用程序生成的模型文件一起使用。 该应用程序实现了流行的Mastermind棋盘游戏。 游戏将首先创建由四个“颜色”(在此实现中为1到6)组成的“代码”,然后进行猜测。 每个猜测还包括四种颜色。 如果猜测的颜色在正确的位置,则猜测的结果将包含一个黑色的图钉。 如果猜测的颜色是“代码”的一部分,但不在正确的位置,则猜测结果将包含一个白色的图钉。 如果“代码”不包含猜测的颜色,则不会输出任何引脚。 应用程序使用Mastermind板的猜测输出,可以自动生成CMPL模型。 然后使用CMPL CBC解算器解决此问题,以生成下一个猜测。 根据我的测试,求解器始终能够在允许的最多12次尝试中猜出正确的解决方案。 设置 确保应用程序可以写入应用程序目录的etc子目录。 它需要将生成的CMPL文件存储在那里,以传递给CMPL CBC解算器,以便获得新的
2021-11-19 21:59:33 11KB solver mastermind mastermind-game cmpl
1
计算机随机生成 7 种颜色中的 4 种。 用户必须通过线索和猜测找出 4 种颜色。 由于计算机生成 4 种颜色,因此计算机可以选择两种、三种或四种相同的颜色
2021-08-07 18:20:53 17KB matlab
1
Master Mind文件的注释
2021-03-21 17:08:52 3KB Python
1
Master Mind was traditionally a 2 player board game played with pegs. Now many computer versions exist. Each person would take a turn playing the game. The person not playing would select 4 coloured pegs from a possible 6 colours, then arrange these pegs in some random order behind a blind, ie. hidden from the player. The player would then try to guess the colour pattern by duplicating the pattern in a series of holes in the playing board. After each set of 4 pegs is inserted, the person not playing would indicate how many of the player's pegs were in the correct position (small black peg), and how many were the correct colour but in the wrong position (small white peg). From this meager feedback, the player would have to lay another 4 pegs down, after which the feedback was given again. This cycle continues until the player correctly identified the hidden pattern of pegs.
2019-12-24 03:01:47 6KB MasterMind
1