src/GameOfLife/Outputs/ConsoleOutput.php
/**
     * Outputs one game step.
     *
     * @param Board $_board Current board
     * @param Bool $_isFinalBoard Indicates whether the simulation ends after this output
     */
Outputs one game step.
@param Board $_board Current board
@param Bool $_isFinalBoard Indicates whether the simulation ends after this output
Outputs one game step . @param Board $_board Current board @param Bool $_isFinalBoard Indicates whether the simulation ends after this output
public function outputBoard(Board $_board, Bool $_isFinalBoard)
    {
        $this->shellOutputHelper->clearScreen();
        $this->printTitle();
        $gameStepString = "Game step: " . ($_board->gameStep() + 1) . "\n";
        echo $this->shellOutputHelper->getCenteredOutputString($gameStepString);
        echo $this->getBoardContentString($_board, "║", "☻", " ");
        if (! $_isFinalBoard)
        {
            echo str_repeat("\n", $this->numberOfNewLinesOutputBoard);
            usleep($this->sleepTime * 1000);
        }
    }
public function outputBoard ( Board $ _board , Bool $ _isFinalBoard ) { $ this -> shellOutputHelper -> clearScreen ( ) ; $ this -> printTitle ( ) ; $ gameStepString = " Game step:  " . ( $ _board -> gameStep ( ) + 1 ) . " \n " ; echo $ this -> shellOutputHelper -> getCenteredOutputString ( $ gameStepString ) ; echo $ this -> getBoardContentString ( $ _board , " ║", " " , " " ; if ( ! $ _isFinalBoard ) { echo str_repeat ( " \n " , $ this -> numberOfNewLinesOutputBoard ) ; usleep ( $ this -> sleepTime * 1000 ) ; } }
Outputs one game step.
Outputs one game step .