word-puzzle-shuffler
Version:
shuffle given two words properly so user can find out the word into the puzzle
72 lines (53 loc) • 2.36 kB
Markdown
[](https://travis-ci.com/OzkanAbdullahoglu/word-puzzle-shuffler) [](https://badge.fury.io/js/word-puzzle-shuffler)

[](https://greenkeeper.io/)
A simple package to shuffle given two words properly to the 3 x 3 matrices.
- [Usage](
- [TODO](
[](https://nodei.co/npm/word-puzzle-shuffler/)
getCellValues returns an array which includes shuffled letters from 0 - 9 indexes,
Total length of the two words have to be 9 to fit in 3 x 3 matrices.
```const shuffledData = shuffle(['LEMON', 'PEAR']);```
```const cellValues = shuffledData.getCellValues;```
```["E","N","O","A","P","M","R","E","L"]```
<p align="center">
<img src="./assets/images/demoCellsValue.png" alt="proper cells value" width="320px" height=160px>
</p>
getFirstWordIndexes returns an array which provides indexes of the first word in 3 x 3 matrices.
```const firstWordIndexes = shuffledData.getFirstWordIndexes;```
```
[
[],
[],
[],
[],
[]
]
```
<p align="center">
<img src="./assets/images/getFirstWordIndexes.png" alt="first word indexes" width="320px" height=160px>
</p>
getSecondWordIndexes returns an array which provides indexes of the second word in 3 x 3 matrices.
```const secondWordIndexes = shuffledData.getSecondWordIndexes;```
```
[
[],
[],
[],
[]
]
```
<p align="center">
<img src="./assets/images/getSecondWordIndexes.png" alt="second word indexes" width="320px" height=160px>
</p>
* Improve the code so this package would work with (n x m ) matrices.
* Add tests included edge cases.