Skip to content

Latest commit

 

History

History
32 lines (26 loc) · 608 Bytes

clear.md

File metadata and controls

32 lines (26 loc) · 608 Bytes

Clear Board

to clear all piece in board, we simply call clear()

example

<?php
use \Ryanhs\Chess\Chess;

$chess = new Chess();
$chess->clear();
echo 'FEN => ' . $chess->generateFen() . PHP_EOL;
echo $chess;

will return

FEN => 8/8/8/8/8/8/8/8 w - - 0 1
   +------------------------+
 8 | .  .  .  .  .  .  .  . |
 7 | .  .  .  .  .  .  .  . |
 6 | .  .  .  .  .  .  .  . |
 5 | .  .  .  .  .  .  .  . |
 4 | .  .  .  .  .  .  .  . |
 3 | .  .  .  .  .  .  .  . |
 2 | .  .  .  .  .  .  .  . |
 1 | .  .  .  .  .  .  .  . |
   +------------------------+
     a  b  c  d  e  f  g  h