Skip to content

Commit

Permalink
initial main function added
Browse files Browse the repository at this point in the history
other directories structure already made and planned as per the requirement.
  • Loading branch information
RishiRajAnand authored Nov 22, 2016
1 parent 4cd52e0 commit 4db433a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict';

/*
* Entry file
* takes input from the user and passes to subsequent route.
*/

var _game = {
on:false,
answerMode:0,
word:'',
hintCounter:0,
};

function main(input) {

if(!_game.on){
input = input.split(' ');
require('./routes/routes')(input,_game);
}
else{
require('./routes/game.route')(input,_game);
}
}
console.log("It has started");
// taking input form user
process.stdin.setEncoding('ascii');
process.stdin.on('data', (input)=>{
main(input.trim());
});

0 comments on commit 4db433a

Please sign in to comment.