Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 591 Bytes

checkmate.md

File metadata and controls

30 lines (23 loc) · 591 Bytes

Checkmate ?

get status by $chess->inCheckmate()

example:

<?php
use \Ryanhs\Chess\Chess;

$chess = new Chess('r1bqk1nr/pppp1Qpp/2n5/2b1p3/2B1P3/8/PPPP1PPP/RNB1K1NR b KQkq - 0 4');
var_dump($chess->inCheckmate()); // return TRUE

board:

   +------------------------+
 8 | r  .  b  q  k  .  n  r |
 7 | p  p  p  p  .  Q  p  p |
 6 | .  .  n  .  .  .  .  . |
 5 | .  .  b  .  p  .  .  . |
 4 | .  .  B  .  P  .  .  . |
 3 | .  .  .  .  .  .  .  . |
 2 | P  P  P  P  .  P  P  P |
 1 | R  N  B  .  K  .  N  R |
   +------------------------+
     a  b  c  d  e  f  g  h