@ifvictr/

Combo Generator

Nodejs

No description

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const words = require("an-array-of-english-words");

const rows = [
    ["N", "B", "D", "M", "J", "P", "R", "S", "T", "L"],
    ["O", "U", "Y", "R", "T", "L", "H", "A", "E", "I"],
    ["T", "L", "N", "A", "C", "D", "E", "O", "R", "S"],
    ["E", "D", "H", "K", "Y", "R", "S", "T", "L", "N"]
];
let combos = [];

for(const c1 of rows[0]) {
    for(const c2 of rows[1]) {
        for(const c3 of rows[2]) {
            for(const c4 of rows[3]) {
                combos.push(c1 + c2 + c3 + c4);
            }
        }
    }
}

combos = combos
    // .filter(combo => combo[0] === "L")
    .filter(combo => words.includes(combo.toLowerCase()));
node v10.16.0