sanderspaas/word-search
Composer 安装命令:
composer require sanderspaas/word-search
包简介
Word search generator.
README 文档
README
Word search generator written in PHP.
Features:
- Supports multiple words and grid sizes
- Supports horizontal and vertical words
- Supports intersecting words
- English, Hebrew, Arabic and Finnish alphabets
Produces a grid for you to output, and list of answers.
HHEOÖ
EÖBAR
LSJFD
LLTOK
OPÖOU
Install
Install via Composer:
$ composer require sanderspaas/word-search "^1.0"
Usage
In English:
use WordSearch\Factory;
use WordSearch\Alphabet\English;
$puzzle = Factory::create(['foo', 'bar'], 15, new English);
In Hebrew with reversing the words:
use WordSearch\Factory;
use WordSearch\Alphabet\Hebrew;
$puzzle = Factory::create(['אבג', 'דהו'], 15, new Hebrew, true);
The Puzzle object contains a toArray method for the puzzle grid
and an iterable WordList object with the answers in. You can use these
to output the puzzle yourself, or use the HTML transformer.
$transformer = new WordSearch\Transformer\HtmlTransformer($puzzle);
echo $transformer->grid();
echo $transformer->wordList();
Development
Tests can be run via Ant:
ant
Credits
This package is a fork of xmeltrut's Word Search.
统计信息
- 总下载量: 43
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-22