Git Product home page Git Product logo

russian-roulette's Introduction

Russian-roulette

This project makes possible to run bots fights of russian roulette.

The main purpose of each bot is surviving in this old game. But this is unusual roulette, here we can have 6 - 1000 bullet slots, and it has 1 - half of slots bullets that are arranged in succession.

What you need to do to start this game is just write your own bot which is implement our API and put it to your-bot folder.

Then we will put our bot to our-bot folder and just run server/index.js file. In the end of battle: server will show score.

API:

You can see some examples of bot implementation in our-bot and your-bot folders.

For start you just need to run npm install. Then you need to create socket.io-client instance and connect to http://localhost:8080 Then you can recieve one of this events:

new_game - means that new game was started. Here you will recieve new game config: lentgh and bullets. Here you can reset old config and set up new one.

opponent_turn - if you recieved this event it means that your opponent made turn and still alive. You get here his decision to rotate revolver cylinder.

your_turn - yeah, great! If you got this event it means that it is time to make your fateful decision. Now you have to emit turn event with only one, but very important parameter. This parameter is boolean, if you provide true - it means that you want rotate revolver cylinder and then shot, if you provide false it - means that you want to shot immediately.

We will run about 10000 times with different revolver config in every round first bot's turn will be chosen randomly.

Have fun and be free! Let the best bot win.

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.