Nenaprogramujem ti Mastermind! Postupuj podľa etického kódexu študenta tvojej univerzity!

The game is designed for two players who play the game


Player 1 (guess numbers and position)


  • The role of the player is to guess the numbers of the other player and their order
  • The player uses a 5x pushbutton to enter the system, while 4 of the buttons function as a number incrementer at that position in the 0-9 range.
  • The fifth button sends the data for review. The addition is attempted, the combination is evaluated.
  • Data is recorded and visualized on the LCD display.
  • If the player guesses the number and its position, the green diode on that position lights up.
  • Otherwise, if the number is not entered, or when the number is guessed, but the position is not judged, the red diode lights up.
  • For a player, the game ends when 10 attempts are exceeded or when the combination is guessed.

  • Player 2 (determines combination of colors, position)


  • In the role of microcontroller Arduino Uno, or other, or AtMega chip.
  • Generates the number 0000-9999 that the player will guess
  • Sent data is verified by user by simple conditional logic
  • If both color and position are guessed, the corresponding diode turns green.
  • In the event of color failure or position, the respective LED lights up red.
  • The Arduino also verifies the number of moves the player has used, examines whether the game is over.
  • The game ends when player 1 guesses all numbers and their positions (all 4 diodes will be green), the entry will be blocked, or 10 attempts will fail.
  • The user is always informed about the game status on the display.

  • Hardware for the project

  • Arduino Uno R3
  • 4x RGB LED WS2812(one module)
  • 5x button - switching
  • LCD 20x4 or 16x2
  • I2C converter for LCD
  • Engagement



    LCD display with I2C converter Arduino Uno
    Vcc 5V
    GND GND
    SDA A4 (SDA)
    SCK/SCL A5 (SCK/SCL)
    Pushbutton Arduino Uno
    IN 1 D2
    IN 2 D3
    IN 3 D4
    IN 4 D5
    Enter D6
    RGB led diodes Arduino Uno
    DIN D13
    GND GND
    5V -
    The 5V pin is connected to an external power supply due to a large current draw, especially when all diodes are on, in the order of 200mA.

    Zapojenie