Skip to content

tadjik1/rock-paper-scissors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rock Paper Scissor online game

Web based (HTML, CSS, JS) rock-paper-scissor game (Wikipedia) Uses modern JS and CSS features such as ES Modules and CSS Animations.

Getting started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Latest versions of Node.js and Chrome should be installed on your PC. This project was developed with Node.js version 10.10.0 and Chrome 68.0.3440.106.

Installing

First you need to clone this repo:

git clone git@github.com:tadjik1/rock-paper-scissors.git

Install dependencies for the project

cd rock-paper-scissors
npm install

Run local server

npm start

If everything goes fine you should see this (or similar message):

Starting up http-server, serving .
Available on:
  http://127.0.0.1:8080
  http://192.168.178.20:8080
Hit CTRL-C to stop the server

This means that now you can open http://127.0.0.1:8080 your browser and work with app.

Development

This application was written using plain JS, CSS and HTML so nothing special requires for developing it. Open cloned folder in your favorite editor and start hacking! The only library that has been used is fast-levenshtein for getting Levenshtein distance between commands and users' input.

Running the tests

Tests could be run with

npm test

It uses Mocha and assert. Special module called esm requires for launching tests, because Node.js doesn't support ES Modules loading without specifying file extensions and Mocha doesn't support extensions when launching tests. This behavior could be changed in future versions so esm module could be removed from mocha running options (in package.json).

Deployment

This application automagically serves by GH Pages, so every push to master branch will trigger deploy.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.