Code Monkey home page Code Monkey logo

eth-game-tictactoe's Introduction

预览

猜棋牌类游戏,将棋盘设置为3*3,率先连城直线的玩家获胜,每局1eth赌金,赢家赢得所有赌金,平局退回赌金

image-20190103223715046

游戏创建成功,对方输入地址加入游戏

image-20190103223828618

游戏开始,提示下一个玩家下棋

image-20190103223936239

错误处理:等待对方下子、已经有棋子位置不可以下子

image-20190103224422321

率先完成直连,游戏结束

image-20190103224157532

下载

git clone [email protected]:bigsui/eth-game-tictactoe.git

编译

truffle develop
> compile

记住端口

metamask 链接 truffle

truffle 默认端口为9545,请自行查看

truffle develop

打开metamask,设置自定义网络,链接truffle develop,并导入两个账号

安装npm包

cd client
npm install
npm start

注意

由于google浏览器,开启两个窗口,当切换metamask用户时,页面会自动刷新,

请另开一个Firefox浏览器,安装metamask 链接并导入账户

player1 google浏览器

player2 Firefox浏览器

即可

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.