Abstract
Return the game corresponding to the given index.
InvalidPGN if the corresponding game cannot be parsed, or if the given game index is larger than the number of games in the underlying PGN data.
Must be between 0 inclusive and gameCount exclusive.
Return an Iterable object allowing to iterate over all the (valid) games within the database.
Example, to print the ASCII representation of all the games within a database:
const database = ... ;
for (const game of database.games()) {
console.log(game.ascii());
}
If the database contains some games that cannot be parsed (i.e. games for which the method game would throw a InvalidPGN exception), those games are ignored during the iteration. WARNING: for this reason, the number of games returned by the iterator may be lower than gameCount.
Generated using TypeDoc
Feb 25, 2024
Describe a set of chess games, each of them being represented by a Game object.