2016-11-28 10:42:58 +00:00
|
|
|
/**
|
|
|
|
* Numberwang operations.
|
|
|
|
*
|
|
|
|
* @author Unknown Male 282
|
|
|
|
* @namespace
|
|
|
|
*/
|
2017-03-23 17:52:20 +00:00
|
|
|
const Numberwang = {
|
2016-11-28 10:42:58 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Numberwang operation. Remain indoors.
|
|
|
|
*
|
|
|
|
* @param {string} input
|
|
|
|
* @param {Object[]} args
|
|
|
|
* @returns {string}
|
|
|
|
*/
|
|
|
|
run: function(input, args) {
|
|
|
|
if (!input) return "Let's play Wangernumb!";
|
2017-04-13 18:08:50 +01:00
|
|
|
const match = input.match(/\d+/);
|
2016-11-28 10:42:58 +00:00
|
|
|
if (match) {
|
|
|
|
return match[0] + "! That's Numberwang!";
|
|
|
|
} else {
|
|
|
|
// That's a bad miss!
|
|
|
|
return "Sorry, that's not Numberwang. Let's rotate the board!";
|
|
|
|
}
|
|
|
|
},
|
2017-02-09 15:09:33 +00:00
|
|
|
|
2016-11-28 10:42:58 +00:00
|
|
|
};
|
2017-03-23 17:52:20 +00:00
|
|
|
|
|
|
|
export default Numberwang;
|