Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
onspli committed Sep 17, 2021
1 parent 5d10b7e commit cf6de1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ echo($pgn->get_fen_after_halfmove(Onspli\Chess\PGN::get_halfmove_number(1, 'b'))
// rnbqkb1r/pppppppp/5n2/8/8/5N2/PPPPPPPP/RNBQKB1R w KQkq - 2 2
```

FEN is returned as `php string` by default. Passing parameter `php $as_object = true` makes it FEN object:
FEN is returned as `string` by default. Passing parameter `$as_object = true` makes it FEN object:
``` php
$pgn = new Onspli\Chess\PGN('1.Nf3 Nf6 2.c4 g6');
echo($pgn->get_current_fen(true)->preview());
Expand Down Expand Up @@ -367,4 +367,6 @@ echo($pgn->get_initial_fen());
// rnbqkb1r/pppp1ppp/5n2/4p3/2P1P3/5N2/PP1P1PPP/RNBQKB1R b KQkq - 0 3
echo($pgn->get_initial_halfmove_number());
// 6
echo($pgn->get_halfmove(6));
// Nc6
```
3 changes: 2 additions & 1 deletion README.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ echo($pgn->get_fen_after_halfmove(2));
echo($pgn->get_fen_after_halfmove(Onspli\Chess\PGN::get_halfmove_number(1, 'b')));
```

FEN is returned as `php string` by default. Passing parameter `php $as_object = true` makes it FEN object:
FEN is returned as `string` by default. Passing parameter `$as_object = true` makes it FEN object:
``` php
$pgn = new Onspli\Chess\PGN('1.Nf3 Nf6 2.c4 g6');
echo($pgn->get_current_fen(true)->preview());
Expand All @@ -167,4 +167,5 @@ PGN with custom initial position:
$pgn = new Onspli\Chess\PGN('[FEN "rnbqkb1r/pppp1ppp/5n2/4p3/2P1P3/5N2/PP1P1PPP/RNBQKB1R b KQkq - 0 3"] 3... Nc6 4. Qb3');
echo($pgn->get_initial_fen());
echo($pgn->get_initial_halfmove_number());
echo($pgn->get_halfmove(6));
```

0 comments on commit cf6de1a

Please sign in to comment.