Skip to content

Stasn13/RPS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rock Paper Scissors Lizard Spock

RPS game with additional weapons inspired by Big Bang Theory series builded on Ethereum blockchain. Live demo link here.

Table of Contents

Technologies Used

  • React bootstraped by Vite
  • React router 6
  • ethers.js(Keep It Simple)

Screenshots

Example screenshot

Setup

Please make sure that your node version > 16

npm run dev or yarn dev

You can check dev-build on http://localhost:3000

To play this game you should be connected to Seplia Network.

Areas for Improvement

We are very appreciate your pull requests. Do not hesistate to make your contributions.

Areas for improvement:

  • Current contract has specific functionality, on j1 timeout j2 can withdraw stakes of both players. To prevent this would be nice to implement auto-submit for j1 if this player away from keyboard.
  • Implement React Context state to avoid props drilling.
  • Cover by unit-tests
  • Fluent design(add toasts, transitions, color scheme and etc)

Mixed strategy Nash equilibria

Player1/Player2 Rock Paper Scissors Spock Lizard
Rock 0,0 -1,1 1,-1 -1,1 1,-1
Paper 1,-1 0,0 -1,1 1,-1 -1,1
Scissors -1,1 1,-1 0,0 -1,1 1,-1
Spock 1,-1 -1,1 1,-1 0,0 -1,1
Lizard -1,1 1,-1 -1,1 1,-1 0,0

A Mixed Strategy Nash Equilibrium exists when players randomize over their strategies, making their opponent indifferent to the choice of their strategy. In RPSLS we can assume that players will randomize their choices leading to equal probability 1/5.