Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.