Overview

Namespaces

  • pgn
    • exceptions
    • tags
  • utils

Classes

  • Annotator
  • Black
  • BlackElo
  • BlackNA
  • BlackTitle
  • BlackType
  • BlackUSCF
  • Board
  • Date
  • ECO
  • Event
  • EventCountry
  • EventDate
  • EventRounds
  • EventSponsor
  • EventType
  • FEN
  • Mode
  • NIC
  • Opening
  • PlyCount
  • Result
  • Round
  • Section
  • SetUp
  • Site
  • Source
  • SourceDate
  • Stage
  • SubVariation
  • Tag
  • Termination
  • Time
  • TimeControl
  • UknownTag
  • UTCDate
  • UTCTime
  • Variation
  • White
  • WhiteElo
  • WhiteNA
  • WhiteTitle
  • WhiteType
  • WhiteUSCF
  • Overview
  • Namespace
  • Class

Class FEN

Description of FEN: This tag uses a string that gives the Forsyth-Edwards Notation for the starting position used in the game. FEN is described in a later section of this document. If a SetUp tag appears with a tag value of "1", the FEN tag pair is also required.

Data fields (6): Piece placement data, Active color, Castling availability, En passant target square, Halfmove clock, Fullmove number

Examples: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1 rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1 rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq c6 0 2 rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2 4k3/8/8/8/8/8/4P3/4K3 w - - 5 39

pgn\tags\Tag
Extended by pgn\tags\FEN
Namespace: pgn\tags
Author: Geraldo
See: pgn_standard.txt
Located at pgn/tags/FEN.php
Methods summary
public the
# getName( )

Returns

the
name of the tag
public boolean
# validate( mixed $data )

Parameters

$data

Returns

boolean
returns if a data is valid

Assert("4k3/8/8/8/8/8/4p3/4k3

w - - 5 39") === true

Assert("a")

=== false

Assert("prq1823br

b kqKQ 1 1 1") === false

Assert("rnbqkbnr/pp1ppppp/8/2p5/4p3/5n2/pppp1ppp/rnbqkb1r

b KQkq - 1 2") === true

Assert("rnbqkbnr/pp1ppppp/8/2p5/4p3/8/pppp1ppp/rnbqkbnr

w KQkq c6 0 2") === true

Assert("rnbqkbnr/pppppppp/8/8/4p3/8/pppp1ppp/rnbqkbnr

b KQkq e3 0 1") === true

Assert("rnbqkbnr/pppppppp/8/8/8/8/pppppppp/rnbqkbnr

w KQkq - 0 1") === true

Assert(2)

=== false

Assert(null)

=== false

Overrides

pgn\tags\Tag::validate()
public static string
# validPattern( )

Get the regex pattern of a valid FEN tag string

Get the regex pattern of a valid FEN tag string

Returns

string
regex pattern of a valid SetUp tag string

Overrides

pgn\tags\Tag::validPattern()
Methods inherited from pgn\tags\Tag
__toString(), createTag(), formatted(), get(), getDefaultValue(), parse(), parseTagName(), parseTagValue(), set()
Properties inherited from pgn\tags\Tag
$data, $errorMsg
API documentation generated by ApiGen