Moved available letters to config.
This commit is contained in:
@@ -11,36 +11,8 @@ const words = require('../../assets/mash-words.json');
|
||||
|
||||
// http://www.thecountdownpage.com/letters.htm
|
||||
const availableLetters = {
|
||||
vowel: [
|
||||
...Array.from({ length: 15 }, () => 'a'),
|
||||
...Array.from({ length: 21 }, () => 'e'),
|
||||
...Array.from({ length: 13 }, () => 'i'),
|
||||
...Array.from({ length: 13 }, () => 'o'),
|
||||
...Array.from({ length: 5 }, () => 'u'),
|
||||
],
|
||||
consonant: [
|
||||
...Array.from({ length: 2 }, () => 'b'),
|
||||
...Array.from({ length: 3 }, () => 'c'),
|
||||
...Array.from({ length: 6 }, () => 'd'),
|
||||
...Array.from({ length: 2 }, () => 'f'),
|
||||
...Array.from({ length: 3 }, () => 'g'),
|
||||
...Array.from({ length: 2 }, () => 'h'),
|
||||
...Array.from({ length: 1 }, () => 'j'),
|
||||
...Array.from({ length: 1 }, () => 'k'),
|
||||
...Array.from({ length: 5 }, () => 'l'),
|
||||
...Array.from({ length: 4 }, () => 'm'),
|
||||
...Array.from({ length: 8 }, () => 'n'),
|
||||
...Array.from({ length: 4 }, () => 'p'),
|
||||
...Array.from({ length: 1 }, () => 'q'),
|
||||
...Array.from({ length: 9 }, () => 'r'),
|
||||
...Array.from({ length: 9 }, () => 's'),
|
||||
...Array.from({ length: 9 }, () => 't'),
|
||||
...Array.from({ length: 1 }, () => 'v'),
|
||||
...Array.from({ length: 1 }, () => 'w'),
|
||||
...Array.from({ length: 1 }, () => 'x'),
|
||||
...Array.from({ length: 1 }, () => 'y'), // Countdown regards Y as a consonant
|
||||
...Array.from({ length: 1 }, () => 'z'),
|
||||
],
|
||||
vowel: Object.entries(config.letters.vowels).flatMap(([vowel, repeat]) => Array.from({ length: repeat }, () => vowel)),
|
||||
consonant: Object.entries(config.letters.consonants).flatMap(([consonant, repeat]) => Array.from({ length: repeat }, () => consonant)),
|
||||
};
|
||||
|
||||
const types = { v: 'vowel', c: 'consonant' };
|
||||
|
||||
Reference in New Issue
Block a user