Code Monkey home page Code Monkey logo

swiftcode's Introduction

SwiftCODE

SwiftCODE is a multiplayer, interactive, realtime typing speed game for coders.

How to play

The app is built around 2 main pages.

  • After logging in, or choosing to be anonymous, the user is redirected to the lobby, where the currently active games are shown. From here, they can choose to join a game or create their own (either single-player or multiplayer) from a set of preconfigured programming languages.

  • Once the user has created or joined a game, they are redirected to the game screen where the code snippet loads. There they wait until another user joins their game, after which the countdown begins. Each game can have a maximum of 4 players. Once the game starts, players must type the provided code as fast as possible. Throughout this, the players' current positions are shown to each other in real-time, and at the end some statistics are shown.

Vision

As programmers, we rely on many tools while coding. A keyboard is usually the most basic and most important of all such tools. Of course, there are far more important skills that a developer must have than typing speed. That being said, however, it's still great fun to hear the keys clicking away as you furiously write out some code. In fact, it's so fun, why not make it into a game? And a multiplayer one at that!

In the past, I've enjoyed typing games, but there is a large difference between typing natural language, and typing code (even the choice of programming language can make a significant difference!). I had found Typing.io a while back, which is great fun - but unfortunately doesn't support any kind of multiplayer.

The goal of this project was to fill that gap - to create a multiplayer, interactive, typing game for developers! I envisioned multiple players simultaneously receiving a piece of code, getting ready, and then racing each other to type out the code, all while streaming the progress of each player to his opponents, and animating their progress via multiple cursors on the player's screen.

Installation

Requirements

  • Node.js and NPM (v0.10)
  • MongoDB (v2.4)

Download

Grab the source code and the NPM dependencies.

git clone https://github.com/voithos/swiftcode.git
cd swiftcode
npm install

Configure

Create a database in MongoDB for SwiftCODE, and create a MongoDB user account that SwiftCODE will use to connect.

mongo
> use swiftcode
> db.addUser({ user: 'swiftcodeuser', pwd: 'password', roles: ['readWrite'] })

Copy the sample settings.js.example.js file to settings.js, and fill out the settings as desired (specifically, you must provide the database settings to your MongoDB).

cd src
cp settings.js.example.js settings.js
vim settings.js

SwiftCODE does not come with code exercises preloaded, but does have a simple admin interface which allows for the definition of new languages, projects, and exercises. An admin user is required to access the interface, which can be created through grunt (note, this requires the database settings to be in place).

grunt add-admin

The following prompt is for a username and a password (must be >= 8 characters). Once an admin user has been added, the admin interface can be accessed after logging in, using the link in the drop-down in the top-right corner of the page.

Run

At this point, SwiftCODE should be fully set up, and runnable.

./runserver.js

Success!

Open Source

Without open source technologies and libraries, this project would not be possible. A great thanks goes to all of their creators. Listed in no particular order:

  • Node.js
  • Express
  • Socket.IO
  • MongoDB and Mongoose
  • Bootstrap
  • jQuery
  • Knockout.js
  • Highlight.js
  • Lo-dash
  • Moment.js
  • Jade
  • Passport
  • Cheerio
  • Helmet
  • Alertify
  • Favico.js
  • Mousetrap
  • And of course, HTML5 itself!

swiftcode's People

Contributors

voithos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swiftcode's Issues

In some sources '%' and '^' symbols are broken

Sometimes I can't input % an ^ characters, they show up as incorrect input when I type them in. I noticed that as I was typing some Clojure source and then some Erlang source.

This is a piece of source from Ring (Clojure), in which I have this bug (in the 1st line, on ^ symbol):

(defn- ^SimpleDateFormat formatter [format]
  (doto (SimpleDateFormat. ^String (http-date-formats format) Locale/US)
    (.setTimeZone (TimeZone/getTimeZone "GMT"))))

(defn- attempt-parse [date format]
  (try
    (.parse (formatter format) date)
    (catch ParseException _ nil)
    ;; Also catch RuntimeExceptions, needed for Clojure 1.3.0
    ;; See: https://groups.google.com/forum/#!topic/clojure/I5l1YHVMgkI
    (catch RuntimeException _ nil)))

(defn- trim-quotes [s]
  (str/replace s #"^'|'$" ""))

Another source pieces containing these characters work fine.

I use a Russian windows keyboard, but its' English layout seems to be the same as on normal US keyboards. Currently I'm using Google Chrome 31.0.1650.63 m on Windows 7.

Doesn't recognize characters written with Alt Gr

It currently doesn't accept any characters written with Alt Gr (Ctrl+Alt) which is needed for many non US keyboard layouts.
For example on the German keyboard layout characters like {, }, [, ], , | and ~ all need the Alt Gr key to work. So it's currently pretty much impossible to play this game.

Tabs in sources

I've found some GLSL code containing tabs in assignment statement after = (for vertical alignment, I guess). Browser switches between interactive elements on the page when I press tab.

No option to change or recover user's password

I think it would be useful to add some basic recover or change password functionality to the app. I've accidentally put a weird password on my username, and there doesn't seem to be an option to change it.

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.