Mastermind is a mind game that is played on a decoding board with a shield covering four colored code pins, the goal is to guess the code and recrea…