2018-05-21 19:37:32 +02:00
|
|
|
/**
|
|
|
|
* @author n1474335 [n1474335@gmail.com]
|
|
|
|
* @copyright Crown Copyright 2018
|
|
|
|
* @license Apache-2.0
|
|
|
|
*/
|
|
|
|
|
2019-07-09 13:23:59 +02:00
|
|
|
import Operation from "../Operation.mjs";
|
2018-05-21 19:37:32 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* XKCD Random Number operation
|
|
|
|
*/
|
|
|
|
class XKCDRandomNumber extends Operation {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* XKCDRandomNumber constructor
|
|
|
|
*/
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
|
|
|
|
this.name = "XKCD Random Number";
|
|
|
|
this.module = "Default";
|
2018-08-21 20:07:13 +02:00
|
|
|
this.description = "RFC 1149.5 specifies 4 as the standard IEEE-vetted random number.";
|
|
|
|
this.infoURL = "https://xkcd.com/221/";
|
2018-05-21 19:37:32 +02:00
|
|
|
this.inputType = "string";
|
|
|
|
this.outputType = "number";
|
|
|
|
this.args = [];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {string} input
|
|
|
|
* @param {Object[]} args
|
|
|
|
* @returns {number}
|
|
|
|
*/
|
|
|
|
run(input, args) {
|
|
|
|
return 4; // chosen by fair dice roll.
|
|
|
|
// guaranteed to be random.
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
export default XKCDRandomNumber;
|