Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chesszebra/forsyth-edwards-notation
This library provides support for reading and writing chess boards in the Forsyth-Edwards notation.
https://github.com/chesszebra/forsyth-edwards-notation
board chess chessboard fen forsyth-edwards forsyth-edwards-notation php reader writer
Last synced: about 1 month ago
JSON representation
This library provides support for reading and writing chess boards in the Forsyth-Edwards notation.
- Host: GitHub
- URL: https://github.com/chesszebra/forsyth-edwards-notation
- Owner: chesszebra
- License: mit
- Created: 2020-03-28T06:22:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-01T21:57:57.000Z (over 3 years ago)
- Last Synced: 2024-04-27T04:41:44.652Z (8 months ago)
- Topics: board, chess, chessboard, fen, forsyth-edwards, forsyth-edwards-notation, php, reader, writer
- Language: PHP
- Homepage: https://chesszebra.com
- Size: 25.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# forsyth-edwards-notation
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Build Status][ico-travis]][link-travis]
[![Total Downloads][ico-downloads]][link-downloads]This library provides support for reading and writing chess boards in the Forsyth-Edwards notation.
## Installation
Via composer
```
composer require chesszebra/forsyth-edwards-notation
```## Usage
### Parse a FEN
```php
use ChessZebra\ForsythEdwardsNotation\FenNotation;$notation = new FenNotation('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1');
```### Convert a FEN to a string
```php
use ChessZebra\ForsythEdwardsNotation\FenNotation;$notation = new FenNotation('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1');
echo $notation->toString(); // or cast it: (string)$notation
```### Validating a FEN
```php
use ChessZebra\ForsythEdwardsNotation\Validator;$validator = new Validator();
$validationResult = $validator->validate('rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1');
// $validationResult is a ValidationResult constant.
```## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.
## Security
If you discover any security related issues, please report them via [HackerOne][link-hackerone].
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
[ico-version]: https://img.shields.io/packagist/v/chesszebra/forsyth-edwards-notation.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/chesszebra/forsyth-edwards-notation/master.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/chesszebra/forsyth-edwards-notation.svg?style=flat-square[link-packagist]: https://packagist.org/packages/chesszebra/forsyth-edwards-notation
[link-travis]: https://travis-ci.org/chesszebra/forsyth-edwards-notation
[link-downloads]: https://packagist.org/packages/chesszebra/forsyth-edwards-notation
[link-contributors]: ../../contributors
[link-hackerone]: https://hackerone.com/chesszebra