From 07d8db2bb758686466d4643f575b4b5280cc4791 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Sun, 4 Apr 2021 00:45:50 +0200 Subject: Add project --- lib/corona-regeln.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/corona-regeln.js (limited to 'lib/corona-regeln.js') diff --git a/lib/corona-regeln.js b/lib/corona-regeln.js new file mode 100644 index 0000000..5036e47 --- /dev/null +++ b/lib/corona-regeln.js @@ -0,0 +1,17 @@ +'use strict'; + +const RuleGenerator = require('./rule_generator'); + +module.exports = { + async run({ + ruleCount + }) { + + const rules = []; + for (let i = 0; i < ruleCount; ++i) { + rules.push(await RuleGenerator.generate()); + } + + return rules.sort(() => Math.random() - 0.5); + } +} -- cgit