PHP code example of tsmsogn / kuwashiro-buster

1. Go to this page and download the library: Download tsmsogn/kuwashiro-buster library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tsmsogn / kuwashiro-buster example snippets




use KuwashiroBuster\Constraints\Generation;
use KuwashiroBuster\Kuwashiro\Kuwashiro;

// クワシロカイガラムシを作る
$kuwashiro = new Kuwashiro(Generation::GENERATION_1);

// 孵化するまで育てる
while (!$kuwashiro->isHatch()) {
    
    // 有効積算温度を取得する
    $yukoSekisanOndo = $kuwashiro->getYukoSekisanOndo();
    // 現在の有効積算温度を取得する
    $currentYukoSekisanOndo = $kuwashiro->getCurrentYukioSekisanOndo();
    
    echo sprintf('(有効積算温度, 現在の有効積算温度) = (%s, %s)', $yukoSekisanOndo, $currentYukoSekisanOndo) . "\n";

    // 気温 20℃で育てる
    $kuwashiro->grow(20);
}