-
Notifications
You must be signed in to change notification settings - Fork 0
/
builder.ts
24 lines (19 loc) · 954 Bytes
/
builder.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { IPositionRequirement, IWordRequirements } from '@/types';
import { PositionRequirement } from './Position';
import { WordRequirements } from './Requirement';
export const buildRequirements = (): IWordRequirements => {
const positionRequirements: IPositionRequirement[] = [];
positionRequirements.push(new PositionRequirement(null, ['O', 'L', 'B', 'D', 'V']));
positionRequirements.push(new PositionRequirement('U', []));
positionRequirements.push(new PositionRequirement(null, ['T', 'A', 'G', 'N', 'C', 'L']));
positionRequirements.push(new PositionRequirement(null, ['E', 'L', 'O', 'D', 'H', 'V']));
positionRequirements.push(new PositionRequirement('A', []));
const lettersThatMustBePresent = ['A', 'U'];
const lettersToIgnore = ['R', 'T', 'S', 'E', 'O', 'P'];
const wordRequirements = new WordRequirements(
lettersThatMustBePresent,
lettersToIgnore,
positionRequirements,
);
return wordRequirements;
};