Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 1.72 KB

File metadata and controls

57 lines (43 loc) · 1.72 KB

Github Structure

"AI-Training" branch for the AI model training.

"blockchain" branch for smart contract implementation.

"UI" branch for the game interface

CryptoCannon Showdown

Click here to play

Play AI in a game of Battleship (also known as Sea Battle) for the chance to win some cryptocurrency.

Users bet an amount of cryptocurrency before starting a game, and then play a game against the AI. If they win, they get their crypto back plus a bit extra. They can also purchase cosmetic NFTs to customize how the game looks, like their ships.

Sequence Diagram

sequenceDiagram
    Participant AI
    Participant Game
    Participant Smart Contract
    Participant User's Wallet
    AI->>Game: Give policy
    Game->>Smart Contract: Start game, wager crypto
    Smart Contract->>User's Wallet: Get crypto from user's account
    User's Wallet->>Smart Contract: return crypto
    loop until game ends
        Game->>Smart Contract: Send move
        Game->>Smart Contract: Send and verify AI move
    end
    Game->>Smart Contract: Game finished
    Smart Contract->>User's Wallet: Pay out(if user wins)
    Game->>AI: Use game data to improve AI
    Game->>Smart Contract: Player buys cosmetic
    Smart Contract->>User's Wallet: Mint + Award NFT to user
Loading

Component Disagram

stateDiagram-v2
    SmartContract --> Game_Webapp
    AI_Model --> SmartContract
    SmartContract --> Blockchain
    Blockchain --> SmartContract
    Game_Webapp --> Player

Loading

Setup

  1. Install docker compose
  2. Run cd smart_contract; docker compose up
  3. Run pip install -r requirements.txt
  4. Run cd server; server.py