Skip to content

enviodev/mincomind

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MincoMind

On chain cows and bulls tournament built on Inco network, leveraging fully homomorphic encryption to enable secret values and randomisation in smart contracts.

Commonly known as Mastermind

Game play

Basics

  • A game is started and there is a secret combination of 4 pegs randomly ordered and coloured from 6 different colours.
  • A player tries to guess the code by placing a sequence of 4 colored pegs.
  • After each guess, the player gets feedback:
    • A black peg for each correct color in the correct position (bull).
    • A white peg for each correct color in the wrong position (cow).
  • Objective: The player uses the feedback to deduce the secret code within 8 attempts.

Tournament

  • Each player is required to deposit 0.0001 inco per game, this goes into a pot.

  • Should the player be unable to solve the puzzle within 8 attempts they forfeit their deposit.

  • If the player successfully solves the puzzle, they receive points and appear on the leaderboard

  • Points can be redeemed proportionally to the inco in the pot.

    points redemption

    where:

    • ( x ) is the withdrawable amount
    • ( y ) is the users points
    • ( z ) is the total points of all users
    • ( v ) is the total deposits in the pot
  • If a user redeems their points they are removed from the leaderboard.

  • Points are calculated as follows

    points per game

    where:

    • ( p ) is the points
    • ( n ) is the total possible attempts (in this case, ( n = 8 ))
    • ( a ) is the number of attempts needed to solve the puzzle
  • Finally, a users total points are the sum of their points from each game.

    total points

    where:

    • ( y ) is the sum of all game points
    • ( pi ) is the points from the ( i )-th game
    • ( k ) is the total number of games played

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 41.6%
  • ReScript 25.4%
  • TypeScript 22.0%
  • Solidity 8.8%
  • HTML 1.6%
  • CSS 0.6%