Coder Social home page Coder Social logo

trivia-game's Introduction

Trivia Game

Play: trivia-game.jit.su

The Challenge

Using Node.js with Socket.IO build a math trivia game. This game will allow for one or more players from multiple locations to participate. A question will appear on the screen, and the first player to submit the correct answer will be awarded points. Anyone can join and leave the room.

The game should be versioned on github, hosted on nodejitsu, and backed by solid tests.

Take as much time as you need, ask as many questions as you'd like, and be as creative as you can. Most importantly, have fun with it.

The Solution

The direction taken was to be as simple and clean as possible, to work well on smart phones and tablets as well as desktop browsers.

Server Stack:

  • node.js 0.8
  • express 3.0
  • socket.io 0.9
  • mocha 1.9

Client Stack:

  • socket.io 0.9
  • backbone 1.0
  • underscore 1.4
  • jquery 2.0
  • twitter bootstrap 2.3

Testing

mocha is the testing framework used. To test, install:

npm install --dev

Run tests

npm test

Game works on Chrome, Safari, iPad, iPhone, android ... NOT tested on IE.

Todo

This list contains ideas. Can be generic (improve design) or specific (store client IP).

  • server: pause game without stopping server
  • server: add config file, so can specify different questions files
  • server: create admin UI (ADVANCED): choose new questions file, reset current questions, pause/resume questions
  • server/client: create shared module creates/interprets json containing question info, etc.
  • client: add fun popups/animations if winner
  • client: improve design
  • client: add treatment to button of correct answer, like flashing green
  • client: add details on players (createTime, lastActiveTime)
  • players: store more player fields: client IP, createTime, lastActiveTime
  • players: store in db. Currently a server restart loose player info
  • questions: support meta info for group of questions: description, version, category
  • questions: support categoy per question (default to questions category if none)

License

(The MIT License)

Copyright (c) 2013 Chad Norwood

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

githalytics.com alpha

trivia-game's People

Contributors

chadn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.