承接 vgip/wordle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

vgip/wordle

最新稳定版本:1.1.1

Composer 安装命令:

composer require vgip/wordle

包简介

Pick words from directory according to conditions

README 文档

README

Pick words from directory according to conditions:

  • the letter is in a word in a defined place;
  • the letter is in a word in a undefined place;
  • the letter is missing from a word.
use Vgip\Wordle\Pick\Pick;
use Vgip\Wordle\Pick\LetterConfigFactory;

/** Get directory of words as array - see example/words_en_5_letter.txt for example */
$pathWords = join(DIRECTORY_SEPARATOR, [__DIR__, 'words_en_5_letter.txt']);
$wordList = file($pathWords);

/** Set conditions to pick of words */
$letterList = [];
$letterList['x'] = false; // The letter "x" is missing from a word.
$letterList['a'] = LetterConfigFactory::factory('defined', [2]); // Set that the letter "a" is in the word in 2nd place
$letterList['n'] = LetterConfigFactory::factory('undefined', [3, 5]); // Set that the letter "n" is not in the word in 3nd and 5nd places

$pick = new Pick();
$candidateList = $pick->getCandidate($wordList, $letterList);
$resultLog = $pick->getResultLog(); 
    
print_r($candidateList);

setSkipWordDoubleLetter()

If set True will be skipped all words with duplicate letters. False set as default.

$pick->setSkipWordDoubleLetter(true);

setResultLogOn()

If set to true, all word selection actions will be logged. False set as default.

$pick->setResultLogOn(true);
$candidateList = $pick->getCandidate($wordList, $letterList);
$resultLog = $pick->getResultLog();
print_r($resultLog);

统计信息

  • 总下载量: 11
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-03-20