You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
555 B
32 lines
555 B
var Values = require('./Values');
|
|
|
|
/**
|
|
*
|
|
*/
|
|
module.exports = {
|
|
level: 0,
|
|
|
|
checkWin: function(values) {
|
|
var len = values.length;
|
|
var remaining = 0;
|
|
|
|
for (var i = 0; i < len; i++) {
|
|
if (Values.validate(values[i], module.exports.level) === true) {
|
|
remaining++;
|
|
}
|
|
}
|
|
|
|
return (remaining === 0);
|
|
},
|
|
|
|
checkLoss: function() {
|
|
|
|
},
|
|
|
|
// State machine mediator.
|
|
state: {
|
|
nextLevel: function() {
|
|
module.exports.level++;
|
|
}
|
|
}
|
|
};
|
|
|