https://github.com/isaccanedo/words
:smile: Package of functions that help to create hunting word game.
https://github.com/isaccanedo/words
cross-word word
Last synced: 11 months ago
JSON representation
:smile: Package of functions that help to create hunting word game.
- Host: GitHub
- URL: https://github.com/isaccanedo/words
- Owner: isaccanedo
- License: mit
- Created: 2023-02-12T12:24:56.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-12T12:28:31.000Z (almost 3 years ago)
- Last Synced: 2025-01-12T06:43:16.914Z (about 1 year ago)
- Topics: cross-word, word
- Language: JavaScript
- Homepage:
- Size: 67.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Words
Package of functions that help to create hunting word game.
How to use?
```shell
npm i hunting-words
```
```js
const { createGame } = require('hunting-words');
const options = {
wordsCross:false,
inverseWord:true,
wordInVertical:true,
wordInHorizontal:true,
wordDiagonalLeft: false,
wordDiagonalRight: false
};
let game = createGame(10, 10, ["word1","word2","word3"], options);
```
- createGame(rows, columns, words, options):
Return
- rows -> number of word search lines
- columns -> columns of word search lines
- words -> array of words that will be in the word search
- options -> json object that contains the game preferences
Return
```json
{
board: array>
words: array ["word1", "word2", "word3"],
rows: 10,
columns: 10,
}
```
createLetter
```json
{
letter: "C"
word: []
row: 0
column: 0
isSelected: false
addNewWord: ƒ (word)
setLetter: ƒ (letter)
setRow: ƒ (row)
setColumn: ƒ (column)
setIsSelected: ƒ (isSelected)
}
```