PHP棋类框架 PHPCheckMate

码农软件 · 软件分类 · 游戏开发包 · 2019-10-06 08:13:09

软件介绍

phpcheckmate 是一个用 PHP 编写的棋类框架,可进行棋子移动和验证,并可悔棋。

示例代码:

$game = new Game();
$game
->make_move("e2", "e3");
$game
->make_move("f7", "f6");
$game
->make_move("d2", "d3");
$game
->make_move("g7", "g5");
$game
->make_move("d1", "h5");
var_dump
($game->player_checkmated("black")); //true #Player2 checkmated
var_dump
($game->result()); //1 #Game is over

$game
->take_back_move(); #Take back last move

var_dump
($game->player_checkmated("black")); //false #Player2 NOT checkmated
var_dump
($game->result()); // false #Player2 can still move its king
$game
->make_move("d1", "h5");
var_dump
($game->player_checkmated("black")); //true #Player2 checkmated

本文地址:https://codercto.com/soft/d/16141.html

Sass and Compass in Action

Sass and Compass in Action

Wynn Netherland、Nathan Weizenbaum、Chris Eppstein、Brandon Mathis / Manning Publications / 2013-8-2 / USD 44.99

Written by Sass and Compass creators * Complete Sass language reference * Covers prominent Compass community plug-ins * Innovative approach to creating stylesheets Cascading Style Sheets paint the we......一起来看看 《Sass and Compass in Action》 这本书的介绍吧!

html转js在线工具
html转js在线工具

html转js在线工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具