diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-12-19 14:21:33 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-12-19 14:21:33 +0100 |
| commit | 5d9f7190bd118fe4d44594d7a9584de98b527467 (patch) | |
| tree | c323938b4626290a227a652380af769d7f4c4518 /src/lib/rules/business.js | |
| parent | 29f687276d9e9ef01ce70ebd210a01386ca581ae (diff) | |
Port to svelte
Diffstat (limited to 'src/lib/rules/business.js')
| -rw-r--r-- | src/lib/rules/business.js | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/lib/rules/business.js b/src/lib/rules/business.js new file mode 100644 index 0000000..d021173 --- /dev/null +++ b/src/lib/rules/business.js @@ -0,0 +1,74 @@ +const internals ={ + + businesses: [ + 'butcher shops', + 'plant shops', + 'balloon factories', + 'pet hotels', + 'sex shops', + 'clothes incineration facilities', + 'city dumps', + 'glass factories', + 'roads', + 'windfarm analysis consultancies', + 'peanut depots', + 'glue factories', + 'bürgeramts', + 'chiropractors', + 'gong bath facilities', + 'wrestling rings', + 'cat cafés', + 'paint your own pottery centers', + 'dungeons', + 'television sets', + 'nasa offices', + 'toilet factories', + 'condom inspection facilities', + 'high school newspapers', + 'dog spas', + 'mink breeding centers', + 'NGOs', + 'yoga cults', + 'MI6 safehouses', + 'döner shops', + 'hospitals' + ], + + restrictions: [ + 'are required to work from home', + 'require mandatory testing', + 'must remain closed', + 'must remain open', + 'must offer 50% covid discounts', + 'must become vaccination centers', + 'must pay staff 3x on thursdays', + 'can only meet with one other household', + 'must share facilities', + 'are exempt from mask rules', + ], + + join(array) { + + const firstPart = array.slice(0, -1).join(', ') + const lastPart = array.slice(-1) + + const conjunction = array.length <= 1 ? '' : ', and ' + + return [firstPart, lastPart].join(conjunction) + } +}; + +export default function () { + + const businesses = internals.businesses + .filter(() => true) + .sort(() => Math.random() - 0.5) + .slice(0, Math.floor(Math.random() * 3) + 1) + const restriction = internals.restrictions[Math.floor(Math.random() * internals.restrictions.length)]; + const text = `${internals.join(businesses)} ${restriction}` + + return { + emoji: '🏢', + text: text.charAt(0).toUpperCase() + text.slice(1) + }; +} |