blob: 2fbc8d5fff8843b3859337836e7422fd448d71c1 [file]
function get(which) {
var phrases = require('../data/'+ which + '.json')[which],
n = random(0, phrases.length - 1);
return phrases[n];
}
function nicejob() {
return get('positive');
}
function not_nicejob() {
return get('negative');
}
function random(min, max) {
if (max == null) {
max = min;
min = 0;
}
return min + Math.floor(Math.random() * (max - min + 1));
}
nicejob.not = not_nicejob;
module.exports = nicejob;