Ethereum Based Master Mind Game Development.
Budget: ₹1,500 – ₹12,500 INR
Mastermind: Description of the game
The goal of the project is to implement the game Mastermind on the Ethereum blockchain and create a Frontend for it in React Js.
Mastermind is a two player code breaking game, i.e. a game in which the objective of one player, the “CodeBreaker” is to figure out the code that the opponent, the “CodeMaker”, has chosen. The codemaker secretly selects a code consisting of an ordered sequence of N colors, CS=(c1 ,c2 , …, cn ), each chosen from a set of M possible colors, with repetitions allowed. The codebreaker then tries to guess the code by repeatedly proposing a sequence of N colors, (g1 ,g2 ,..., gn ). After each guess, the CodeMaker notifies the CodeBreaker two numbers: CC, the number of colors belonging to CS in the correct positions, and NC the number of colors belonging to CS, but not in the correct positions. The CodeBreaker continues guessing until they guess the code correctly or until they reach a maximum allowable number of guesses without having correctly identified the secret code.
The CodeBreaker and the codemaker jointly decide the even number of turns NT, of the
game. In each turn, one of the players acts as CodeBreaker and the other as CodeMaker, then they swap their roles. For each turn, the CodeBreaker has a maximum fixed number of guesses (NG).
At the end of each turn, the number of guesses that the CodeBreaker needed to crack the secret code is the number of points awarded to the other player, the CodeMaker. If the CodeBreaker does not end up breaking the code, K extra points are awarded to the CodeMaker.
At the end of the agreed number of rounds NT, the scores are tallied up and the player with more points wins. In the real world, the CodeMaker places the pegs corresponding to the code they have chosen behind a shield, the codebreaker places its pegs on the other part of the board. There are smaller holes on the right of the board, where the CodeMaker places white and black smaller pegs. Each black peg corresponds to a color correctly guessed in the correct position by the codebreaker, while a white peg corresponds to a color correctly guessed, but in the wrong position. For a better understanding, attached image, shows the board used in a real game, played in the
physical world. Note that the gray small circles on the right are not occupied by any peg.
The goal of the project is to implement a blockchain based version of the classical
MasterMind game, based on the development of a set of smart contracts written in Solidity and executed on a EVM based blockchain.
Since the Blockchain maintains a public ledger, a CodeMaker cannot publish the secret code on the ledger, otherwise it would be visible to the codebreaker.
On the other side, the blockchain is exploited:
● to guarantee that the secret chosen by the codemaker at the beginning of each turn
is not modified later, before the CodeMaker discloses it;
● to check that each feedback given by the CodeMaker to the CodeBreaker, at each
turn, is consistent with the secret code chosen by the CodeMaker at the beginning of
the game;
● to implement a rewarding mechanism for winning players;
● to define a penalty mechanism for cheating CodeMakers and for players that take no
action at a particular turn, thus preventing the advancement of the game.
The goal of the project is to implement the game Mastermind on the Ethereum blockchain and create a Frontend for it in React Js.
Mastermind is a two player code breaking game, i.e. a game in which the objective of one player, the “CodeBreaker” is to figure out the code that the opponent, the “CodeMaker”, has chosen. The codemaker secretly selects a code consisting of an ordered sequence of N colors, CS=(c1 ,c2 , …, cn ), each chosen from a set of M possible colors, with repetitions allowed. The codebreaker then tries to guess the code by repeatedly proposing a sequence of N colors, (g1 ,g2 ,..., gn ). After each guess, the CodeMaker notifies the CodeBreaker two numbers: CC, the number of colors belonging to CS in the correct positions, and NC the number of colors belonging to CS, but not in the correct positions. The CodeBreaker continues guessing until they guess the code correctly or until they reach a maximum allowable number of guesses without having correctly identified the secret code.
The CodeBreaker and the codemaker jointly decide the even number of turns NT, of the
game. In each turn, one of the players acts as CodeBreaker and the other as CodeMaker, then they swap their roles. For each turn, the CodeBreaker has a maximum fixed number of guesses (NG).
At the end of each turn, the number of guesses that the CodeBreaker needed to crack the secret code is the number of points awarded to the other player, the CodeMaker. If the CodeBreaker does not end up breaking the code, K extra points are awarded to the CodeMaker.
At the end of the agreed number of rounds NT, the scores are tallied up and the player with more points wins. In the real world, the CodeMaker places the pegs corresponding to the code they have chosen behind a shield, the codebreaker places its pegs on the other part of the board. There are smaller holes on the right of the board, where the CodeMaker places white and black smaller pegs. Each black peg corresponds to a color correctly guessed in the correct position by the codebreaker, while a white peg corresponds to a color correctly guessed, but in the wrong position. For a better understanding, attached image, shows the board used in a real game, played in the
physical world. Note that the gray small circles on the right are not occupied by any peg.
The goal of the project is to implement a blockchain based version of the classical
MasterMind game, based on the development of a set of smart contracts written in Solidity and executed on a EVM based blockchain.
Since the Blockchain maintains a public ledger, a CodeMaker cannot publish the secret code on the ledger, otherwise it would be visible to the codebreaker.
On the other side, the blockchain is exploited:
● to guarantee that the secret chosen by the codemaker at the beginning of each turn
is not modified later, before the CodeMaker discloses it;
● to check that each feedback given by the CodeMaker to the CodeBreaker, at each
turn, is consistent with the secret code chosen by the CodeMaker at the beginning of
the game;
● to implement a rewarding mechanism for winning players;
● to define a penalty mechanism for cheating CodeMakers and for players that take no
action at a particular turn, thus preventing the advancement of the game.