Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jntn/wordcube
A module to create word cubes with solutions for use in word games
https://github.com/jntn/wordcube
Last synced: about 1 month ago
JSON representation
A module to create word cubes with solutions for use in word games
- Host: GitHub
- URL: https://github.com/jntn/wordcube
- Owner: jntn
- Created: 2011-06-17T18:35:39.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-06-26T20:25:21.000Z (over 12 years ago)
- Last Synced: 2023-03-02T15:13:49.388Z (almost 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 289 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# wordcube #
A library to create word grid of letters with hidden words. The words can be found by tracing in any direction horizontally or vertically. Here is an example with the word PUZZLE highlighted.
A
P
E
P
N
H
U
Z
Z
Q
K
J
E
L
I
S
P
M
N
Y
D
I
X
G
A
To create a 5x5 word game with random words from a word list:
var wordsearch = require('wordsearch');
var wordList = ['CAT', 'MOUSE', ... ]
wordcube.createWordcube(5, 5, wordList, function(wordGrid) {
//use wordGrid!
});var solver = require('solver')
solver.solve(square, ['CAT', 'MOUSE', ... ], function(solvedWordGrid) {
//use solvedWordGrid which contains found word and their position in the wordGrid
});The word list is a sorted array of uppercase words.