license: Add license documents and specify version

The readme says this project is licensed under the LGPL, but does
not specify a version or include the license text. This commit adds
the LGPL license as COPYING.LESSER and the GPL which it requires
as COPYING. These are the v3+ versions of the license.

This commit also applies formatting fixes to README.md
This commit is contained in:
wugapodes
2020-01-06 14:47:19 -08:00
parent d3773ab4fb
commit 375f40e374
3 changed files with 849 additions and 10 deletions

20
README.md Executable file → Normal file
View File

@@ -1,13 +1,13 @@
##PGN to PHP array parser
# PGN to PHP array parser
PHP class for conversion of Chess PGN files to PHP array or JSON.
This is the chess parser used in DHTML Chess at dhtml-chess.com
This is the chess parser used in DHTML Chess at [dhtml-chess.com]
####License: LGPL (Lesser General Public License).
* License: LGPL (Lesser General Public License).
#####Example of use:
## Example of use:
######1) Import games from PGN file:
### Import games from PGN file:
```PHP
<?php
@@ -253,7 +253,7 @@ This will give you data in this format:
```
######2) Create parser from PGN String
### Create parser from PGN String
```PHP
$pgn = '[Event "Moscow Championship (blitz) 2015"]
@@ -289,7 +289,7 @@ echo json_encode($game);
```
######3) Create a game programatically.
### Create a game programatically.
This uses the FenParser0x88 class:
```PHP
@@ -299,9 +299,9 @@ $parser->move("g1f3");
$notation = $parser->getNotation(); // returns Nf3
$fen = $parser->getFen();
// $fen = rnbqkbnr/pppppppp/8/8/8/5N2/PPPPPPPP/RNBQKB1R b KQkq - 1 1
```
```
######4) Get valid moves
### Get valid moves
```PHP
$parser = new FenParser0x88('6k1/6p1/4n3/8/8/8/B7/6K1 b - - 0 1');
@@ -319,4 +319,4 @@ where key, example "g8" is the square of a piece and ["f7","h7","f8","h8"] are a
for the piece on that square.
In this example, there's a knight on e6. However, it cannot move because it is pinned by a white
bishop on a2. Thus, the valid moves array for "e6" is empty.
bishop on a2. Thus, the valid moves array for "e6" is empty.