Crossword definition.
Creates a model for a crossword game
Based on https://github.com/jweisbeck/Crossword
The definition verifies the words and the bounds, ensuring the clues are coherent
The instance of the class is a valid model with all the cells of the board
@example```typescript
let definition = new CrosswordDefinition({
width:5,
height:5,
acrossClues:[
{
number:1,
answer:"Hello",
x:1,
y:2,
clue:"A common greeting"
}
],
downClues:[
{
number:2,
answer:"World",
x:5,
y:1,
clue:"The earth, together with all of its countries and peoples"
}
]
});
@example This example will throw error because the height specified must be 5 ("World" length in this case)
```typescript
let definition = new CrosswordDefinition({
width:5,
height:4,
acrossClues:[
{
number:1,
answer:"Hello",
x:1,
y:2,
clue:"A common greeting"
}
],
downClues:[
{
number:2,
answer:"World",
x:5,
y:1,
clue:"The earth, together with all of its countries and peoples"
}
]
});
@example This example will throw error, the position of "World" doesn't match with the acrossClue
This is the given coordinates:
W
Hello
rld
The 'o' from 'World' doesn't match with 'Hello'
let definition = new CrosswordDefinition({
width:5,
height:5,
acrossClues:[
{
number:1,
answer:"Hello",
x:1,
y:2,
clue:"A common greeting"
}
],
downClues:[
{
number:2,
answer:"World",
x:4,
y:1,
clue:"The earth, together with all of its countries and peoples"
}
]
});
Crossword definition. Creates a model for a crossword game Based on https://github.com/jweisbeck/Crossword The definition verifies the words and the bounds, ensuring the clues are coherent The instance of the class is a valid model with all the cells of the board @example```typescript let definition = new CrosswordDefinition({ width:5, height:5, acrossClues:[ { number:1, answer:"Hello", x:1, y:2, clue:"A common greeting" } ], downClues:[ { number:2, answer:"World", x:5, y:1, clue:"The earth, together with all of its countries and peoples" } ] });
@example This example will throw error because the height specified must be 5 ("World" length in this case) ```typescript let definition = new CrosswordDefinition({ width:5, height:4, acrossClues:[ { number:1, answer:"Hello", x:1, y:2, clue:"A common greeting" } ], downClues:[ { number:2, answer:"World", x:5, y:1, clue:"The earth, together with all of its countries and peoples" } ] });
@example This example will throw error, the position of "World" doesn't match with the acrossClue This is the given coordinates:
W Hello r l d
The 'o' from 'World' doesn't match with 'Hello'
let definition = new CrosswordDefinition({ width:5, height:5, acrossClues:[ { number:1, answer:"Hello", x:1, y:2, clue:"A common greeting" } ], downClues:[ { number:2, answer:"World", x:4, y:1, clue:"The earth, together with all of its countries and peoples" } ] });