Added Hunt (hangman) game.
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
const crypto = require('crypto');
|
||||
|
||||
function pickRandom(array) {
|
||||
if (array.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return array[crypto.randomInt(0, array.length)];
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ function shieldMethods(methods) {
|
||||
return Object.fromEntries(Object.entries(methods).map(([key, method]) => [key, curate(method)]));
|
||||
}
|
||||
|
||||
module.exports = (() => {
|
||||
const styleMethods = (() => {
|
||||
if (config.platform === 'irc') {
|
||||
return shieldMethods({
|
||||
...styles,
|
||||
@@ -66,3 +66,12 @@ module.exports = (() => {
|
||||
|
||||
return null;
|
||||
})();
|
||||
|
||||
const expandedMethods = {
|
||||
...styleMethods,
|
||||
username: (value) => styleMethods.bold(styleMethods.cyan(value)),
|
||||
time: (value) => styleMethods.bold(styleMethods.green(value)),
|
||||
answer: (value) => styleMethods.bold(styleMethods.yellow(value)),
|
||||
};
|
||||
|
||||
module.exports = expandedMethods;
|
||||
|
||||
Reference in New Issue
Block a user