PHP Classes

File: build-words

Recommend this page to a friend!
  Classes of Rodolfo Berrios Arce   Wordle CLI   build-words   Download  
File: build-words
Role: Example script
Content type: text/plain
Description: Example script
Class: Wordle CLI
Run the Wordle game on the command line console
Author: By
Last change:
Date: 26 days ago
Size: 724 bytes
 

Contents

Class file image Download
#!/usr/bin/env php
<?php

/*
 * This file is part of Chevere.
 *
 * (c) Rodolfo Berrios <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

use
Rodber\Wordle\Wordlist;

use function
Chevere\Filesystem\directoryForPath;
use function
Chevere\Filesystem\fileForPath;

require_once
__DIR__ . '/vendor/autoload.php';

echo
"? Build wordlists (3,8) for langs\n";
foreach([
'en', 'es', 'pt'] as $lang) {
    echo
"* Processing... $lang";
   
$file = fileForPath(__DIR__ . "/wordlist/$lang");
   
$dir = directoryForPath(__DIR__ . "/app/lang/$lang/words");
    (new
Wordlist($file))->split($dir);
}