Giter VIP home page Giter VIP logo

god's Introduction

God - The Game of Dice

  • Programming Languages: Ruby
  • Test Cases: Rspec

How to run

  • To start the game, use the terminal, go to 'God/lib' and run ruby God-play.rb and follow the instructions on screen.
  • To run test rspec spec

Data Model

User (player)
   - id
   - name
   - email
   - password
   - contact

index on id and email col.

Game (game info)

 - id
 - name
 - some setings

index on id col.

GameRoom

  - id (int NOT NULL AUTO_INCREMENT)
  - game_id: Game (game_id)
  - created_by: User(user_id)
  - timestamp (datetime)
  - status enum(start, in_play, done)

index on id col.

GameRoomPlayer (joinsbetwen GameRoom and User model)

  - id (int NOT NULL AUTO_INCREMENT)
  - user_id User(user_id)
  - game_room_id GameRoom(game_room_id)
  - status enum(in_play, finished)
  - score (int)
  - order (int)
  - rank (int)
  - round_and_point [{ round: 1, point: 2 }, { round: 2, point: 4 }, {} ...]
  - timestamp

index on id col. index on game_room_player, [:game_room_id, :user_id], unique: true

Small Description

  • We will be having a User (player) model which handles the user registration/login process.
  • Game model is for storing the game infos and some generic settings.
  • GameRoom model is a important model which will store info about on going game. (Details of who started the game, status and etc.))
  • GameRoomPlayer is a join between user and game room model which will store data related to each and every round such as status, score, order, rank, round_and_point etc. Here we will append a new object({ round: 1, point: 2 }) to an array of each and every dice roll.

API's:

Api: Get /gameRoom Header: user_token

{
    - uuid
    - game_id
    - created_by
    - timestamp
    - status
}
Api: Post /joinRoom/:uuid
Header: user_token

{
   gameInfo: {}
   players: []
}
Api: Get /gameRoom/:uuid

Header: user_token
{
    gameInfo: {}
    GameRoomPlayer: {}
}

Api: Get /gameRoom/:uuid/histories

Header: user_token

[
    {
        gameInfo: {}
        GameRoomPlayer: {}
    },
    {
        gameInfo: {}
        GameRoomPlayer: {}
    }, 
    {},
    ...
    ..

]
Api: Get /gameRoom/:uuid/status

Header: user_token
{
    gameInfo: {}
}

god's People

Contributors

rankitranjan avatar

Watchers

James Cloos avatar  avatar

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.