Skip to content
/ Morra Public

A DApp that implements the business logic of the game of Morra.

Notifications You must be signed in to change notification settings

Aro1914/Morra

Repository files navigation

Morra 🤗

This is a smart contract built with Reach that implements the business logic for the friendly game of Morra.

Setup

  • You must have WSL installed in your computer and Docker working too, to be able to run the containerized Reach application successfully.
    Follow the very comprehensive guide on how to get this done in the Quickstart section of the Reach Docs.
  • You should have a TestNet connected to your MetaMask Wallet, or instead use MyAlgo Wallet it spins a wallet in TestNet for you.

Usage

To run the app, on your terminal, after you have downloaded Reach through the setup, run the following commands to lauch the application and contract:

$ <path to your Reach file>/reach react

To set your TestNet before the run, use the following command:

$ REACH_CONNECTOR_MODE=<The TestNet name> <path to your Reach file>/reach react

The supported options are ETH, ALGO, CFX, for the Ethereum, Algorand, and Conflux TestNets respectively.

Gameplay

To enjoy this game, its best to open the app in two browser tabs, one for Alice (the Deployer) and one for Bob (the Attacher).

Launch the Game

Screenshot (439)

Connect to your account

Screenshot (440)

Screenshot (441)

Screenshot (442)

Optionally fund your account from a faucet or skip

Screenshot (444)

Screenshot (445)

Select the roles

Screenshot (446)

Screenshot (447)

As the Deployer, set the wager for the game and deploy

Screenshot (448)

Screenshot (449)

Screenshot (450)

Screenshot (451)

Screenshot (452)

Copy the contract info to the Attacher's form field to attach to the contract

Screenshot (453)

Screenshot (454)

The Attacher gets to review the terms of the contract

Screenshot (455)

Screenshot (456)

Screenshot (458)

Upon attaching, Alice gets notified of the attachment and proceeds to play her turn

Screenshot (459)

Screenshot (460)

Screenshot (462)

After Alice plays her turn, Bob gets to play his

Screenshot (463)

Screenshot (464)

Both wait to see the outcome of the game

Screenshot (465)

When a winner is discerned, the results is displayed to both participants

Note: A winner is only decided when only one player guessed the total outcome right, if not they will play again.

Screenshot (467)

For getting this far, I urge you to checkout the Reach Docs and play around with building smart contract and DApps