packages feed

bishbosh 0.0.0.2 → 0.0.0.3

raw patch · 21 files changed

+125/−140 lines, 21 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

README.markdown view
@@ -1,6 +1,9 @@ # **BishBosh** -[![Hackage](https://img.shields.io/hackage/v/bishbosh.svg)](https://hackage.haskell.org/package/bishbosh) [![Build Status](https://travis-ci.org/functionalley/BishBosh.svg?branch=master)](https://travis-ci.org/functionalley/BishBosh)+[![Build Status](https://travis-ci.org/functionalley/BishBosh.svg?branch=master)](https://travis-ci.org/functionalley/BishBosh)+[![Hackage](https://img.shields.io/hackage/v/bishbosh.svg)](https://hackage.haskell.org/package/bishbosh)+[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)+[![Haskell](https://b.repl.ca/v1/language-haskell-yellow.png)](https://haskell.org)  This is "**BishBosh**", a chess-game which can be rendered in a terminal (emulator) using raw ASCII, or used as an engine by **xboard**. @@ -27,6 +30,8 @@     cabal configure --enable-tests;     cabal build;     cabal test --show-details=always;++It's currently only been tested on **Linux**.  ## Author 
bishbosh.cabal view
@@ -14,7 +14,7 @@ -- along with BishBosh.  If not, see <http://www.gnu.org/licenses/>.  Name:		bishbosh-Version:	0.0.0.2+Version:	0.0.0.3 Cabal-version:	>= 1.10 Copyright:	(C) 2018 Dr. Alistair Ward License:	GPL@@ -25,12 +25,12 @@ Build-type:	Simple Description:	A chess-game which can be rendered in a terminal (emulator) in raw ASCII, or used as an engine by xboard. Category:	Game-Tested-with:	GHC == 8.0, GHC == 8.2+Tested-with:	GHC == 8.0, GHC == 8.2, GHC == 8.4 Homepage:	https://functionalley.eu/BishBosh/bishbosh.html Maintainer:	mailto:bishbosh@functionalley.eu Bug-reports:	mailto:bishbosh@functionalley.eu --- These files can be read by the application from 'Paths_bishbosh.datadir'.+-- Files which can be located by the application using 'Paths_bishbosh.datadir'. Data-files:     config/bishbosh.dtd     config/bishbosh.rng@@ -38,7 +38,7 @@     config/Raw/*.xml     pgn/*.pgn --- None of these files are needed at run-time.+-- Files which are packaged, but not required at runtime. Extra-source-files:     .ghci     bishbosh.spec@@ -71,19 +71,20 @@     Description:	Link with package "hxt-relaxng" when available, for more precise specification of the XML-configuration than a traditional DTD.     Default:		True --- Whether to use narrower numerical types than machine-defaults. CAVEAT: bizarely, this option increases both the space allocated & the execution-time.+-- Whether to use narrower numerical types than machine-defaults. CAVEAT: this option increases both the space allocated & the execution-time. flag narrownumbers     Description:	Use narrow numerical types.     Manual:		True     Default:		False --- Highly recommended.+-- Concurrency is used to implement Pondering, & parallelism is used when searching through archived games. flag threaded     Description:	Build for parallel runtime.     Manual:		True     Default:		True --- Automatically disabled when the required package isn't available, which will typically be the case on Windows.+-- Automatically disabled when the required package isn't available.+-- CAVEAT: on MS-Windows, it may be available but won't necessarily build, so specify "-f -unix --verbose" when configuring the package.  flag unix     Description:	Link with package "unix" when available.     Default:		True@@ -236,7 +237,7 @@     Hs-source-dirs:	src-exe     Main-is:		Main.hs --- Required for 'cabal sdist'.+-- N.B.: required for 'cabal sdist'.     Other-modules:         BishBosh.Concurrent.Pondering         BishBosh.Input.CommandLineOption@@ -246,6 +247,7 @@         BishBosh.Text.Show         BishBosh.UI.CECP         BishBosh.UI.Raw+        Paths_bishbosh      if flag(unix)         Other-modules:@@ -294,8 +296,6 @@     if flag(hxtrelaxng)         Build-depends:	hxt-relaxng         CPP-Options:	-DUSE_HXTRELAXNG=1-    else-        Build-depends:	parsec      if flag(narrownumbers)         CPP-Options:	-DUSE_NARROW_NUMBERS=1@@ -303,7 +303,7 @@     if flag(threaded)         GHC-options:	-threaded --- N.B.: The Haskell package 'unix' may be available on Windows, but building it will probably be laborious.+-- N.B.: The Haskell package 'unix' may be available on MS-Windows, but building it will probably be laborious.     if flag(unix)         Other-modules:	BishBosh.Concurrent.SignalHandlers         Build-depends:	unix@@ -392,6 +392,7 @@         BishBosh.Test.QuickCheck.UI.Command         BishBosh.Test.QuickCheck.UI.PrintObject         BishBosh.Test.QuickCheck.UI.SetObject+        Paths_bishbosh      Build-depends:         array >= 0.5.1.1,
bishbosh.spec view
@@ -24,7 +24,7 @@  Summary:	BishBosh is a chess-game. Name:		bishbosh-Version:	0.0.0.2+Version:	0.0.0.3 Release:	1 License:	GPLv3 # From '/usr/share/doc/packages/rpm/GROUPS'.
changelog.markdown view
@@ -5,3 +5,6 @@  ## 0.0.0.2 Minor changes required to build on Windows.++## 0.0.0.3+Added **Paths_bishbosh** to **Other-modules** section of cabal file.
config/CECP/bishbosh_black.xml view
@@ -62,7 +62,7 @@ 			<identificationTag tag="FICSGamesDBGameNo"/> --> 		</pgnOptions>-		<persistence filePath="/dev/null" automatic="False"/>+		<persistence filePath="/dev/null" automatic="False"/>	<!-- replace *nix-specific path with 'nul' in Windows ? --> 		<uiOptions moveNotation="Coordinate" verbosity="Silent"> 			<cecpOptions/> 		</uiOptions>
config/Raw/bishbosh_prof.xml view
@@ -60,7 +60,7 @@ 			<identificationTag tag="ECO"/> 			<identificationTag tag="Variation"/> 		</pgnOptions>-		<persistence filePath="/dev/null" automatic="False"/>+		<persistence filePath="/dev/null" automatic="False"/>	<!-- replace *nix-specific path with 'nul' in Windows ? --> 		<uiOptions verbosity="Silent"/> 	</ioOptions> </options>
man/man1/bishbosh.1 view
@@ -1,21 +1,3 @@-\" AUTHOR: Dr. Alistair Ward-\" Copyright (C) 2018 Dr. Alistair Ward-\"-\" This file is part of BishBosh.-\" -\" BishBosh is free software: you can redistribute it and/or modify-\" it under the terms of the GNU General Public License as published by-\" the Free Software Foundation, either version 3 of the License, or-\" (at your option) any later version.-\" -\" BishBosh is distributed in the hope that it will be useful,-\" but WITHOUT ANY WARRANTY; without even the implied warranty of-\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the-\" GNU General Public License for more details.-\" -\" You should have received a copy of the GNU General Public License-\" along with BishBosh.  If not, see <https://www.gnu.org/licenses/>.- .TH bishbosh 1 .SH NAME \fBbishbosh\fR - Plays Chess@@ -39,17 +21,17 @@ .IP \(bu Unlimited roll-back of moves. .IP \(bu-Comprehension of a variety of \fBhttps://en.wikipedia.org/wiki/Chess_notation\fRs.+Configurable \fBhttps://en.wikipedia.org/wiki/Chess_notation\fR. .IP \(bu The ability to read PGN-databases of standard openings & archived games,-in which it can match both \fBhttps://chessprogramming.wikispaces.com/Transposition\fRs & colour-flipped (\fBhttps://chessprogramming.wikispaces.com/Color+Flipping\fR) positions.+in which it can match both \fBhttps://chessprogramming.wikispaces.com/Transposition\fR s & colour-flipped (\fBhttps://chessprogramming.wikispaces.com/Color+Flipping\fR) positions. .IP \(bu Automation of the moves for either, neither, or both players. Both the evaluation of moves & the search for the optimum, are highly configurable; see \fBsection-5\fR of the man-pages. .IP \(bu Optional hints for manual players. .IP \(bu-\fBhttps://chessprogramming.wikispaces.com/Pondering\fR.+\fBhttps://chessprogramming.wikispaces.com/Pondering\fR . .SS Implementation Some understanding of the algorithm used to automatically select moves, is useful either when configuring this application or when interpreting the esoteric feedback available after move-selection (given "\fB--verbosity=Deafening\fR"). The algorithm first compares the position with those in the referenced PGN-databases; a looser criterion than whether a matching move-sequence exists.@@ -57,11 +39,14 @@ The next move will be selected randomly from the subset of victorious matching positions, in preference to the non-victorious subset. .PP On failure to match the position with an archived game, the tree of all possible moves until the end of the game, is constructed & statically sorted to advance the subsequent evaluation of capture-moves,-using either \fBhttps://chessprogramming.wikispaces.com/MVV-LVA\fR or \fBhttps://chessprogramming.wikispaces.com/Static+Exchange+Evaluation\fR.-On each move, this tree's non-capture moves are dynamically sorted using the \fBhttps://chessprogramming.wikispaces.com/Killer+Heuristic\fR & the \fBhttps://chessprogramming.wikispaces.com/History+Heuristic\fR.+using either \fBhttps://chessprogramming.wikispaces.com/MVV-LVA\fR or \fBhttps://chessprogramming.wikispaces.com/Static+Exchange+Evaluation\fR .+On each move, this tree's non-capture moves are dynamically sorted using the \fBhttps://chessprogramming.wikispaces.com/Killer+Heuristic\fR & the \fBhttps://chessprogramming.wikispaces.com/History+Heuristic\fR .+.br This tree is then searched using a \fBhttps://chessprogramming.wikispaces.com/Negamax\fR algorithm with \fBhttps://chessprogramming.wikispaces.com/Alpha-Beta\fR pruning, over a constant configurable number of plies, to find the optimal move according to the weighted-mean of various criteria described in \fBsection-5\fR of the man-pages.-Shortcuts in the search for the optimal move are taken on encountering either \fBhttps://chessprogramming.wikispaces.com/Repetitions\fR in the move-sequence or \fBhttps://chessprogramming.wikispaces.com/Transposition\fRs of sibling games.+.br+Shortcuts in the search for the optimal move are taken on encountering either \fBhttps://chessprogramming.wikispaces.com/Repetitions\fR in the move-sequence,+or transpositions (\fBhttps://chessprogramming.wikispaces.com/Transposition\fR) of sibling games. .SH OPTIONS .SS "Input" .TP@@ -76,14 +61,14 @@ In the absence of the whole field, the random-number generator will be seeded unpredictably from the operating-system. In the absence of just the argument, "\fB0\fR" will be inferred. .br-N.B.: this application only makes significant use of the random-generator when selecting a move from any configured PGN-databases (see "\fBpgnOptions\fR" in \fBsection-5\fR of the man-pages); automated move-selection is deterministic.+N.B.: this application only makes significant use of the random-generator when selecting a move from any configured PGN-databases (see "\fBpgnOptions\fR" in \fBsection-5\fR of the man-pages); move-selection is otherwise deterministic. .SS "Output" .TP \fB--verbosity=\fR(\fBSilent\fR|\fBNormal\fR|\fBVerbose\fR|\fBDeafening\fR), defaulting to "\fBNormal\fR". Defines the quantity of ancillary output required. See "\fBverbosity\fR" in \fBsection-5\fR of the man-pages. .TP \fB--printMoveTree\fR=\fI<Int>\fR-Print the tree of all possible moves in the game, truncated to the specified depth; see \fBsection-5\fR of the man-pages for details.+Print the tree of all possible moves in the configured notation, each annotated by a fitness-evaluation for the resulting position, truncated to the specified number of plies; see \fBsection-5\fR of the man-pages for details. .SS "Generic Program-information" .TP \fB-v\fR, \fB--version\fR@@ -126,28 +111,35 @@ \fB0\fR on success, & >\fB0\fR if an error occurs. .SH EXAMPLES .nf-.B bishbosh --verbosity=Verbose -i '/usr/share/bishbosh/config/Raw/bishbosh_white.xml'+.B bishbosh --verbosity=Verbose -i ~/.cabal/share/*/bishbosh-*/config/Raw/bishbosh_white.xml .fi .IP \(bu The application has been instructed to provide a relatively large amount of feedback. .IP \(bu-One of the packaged configuration-files has been referenced (you'll need to adjust this if run from the build-directory), which automates White's moves & specifies a raw ASCII interface.+One of the packaged configuration-files has been referenced, which automates White's moves & specifies a raw ASCII interface; on \fBMS-Windows\fR you'll need to issue this from a terminal-emulator which understands \fBhttps://en.wikipedia.org/wiki/ANSI_escape_code\fR .+This path includes both an architecture-specific & a version-specific directory, which are represented as globs & expanded by \fBbash\fR; on \fBMS-Windows\fR you may need to be more explicit.+.IP \(bu+CAVEAT: assumes that the executable exists on \fB$PATH\fR, otherwise an explicit path will be required. .PP .nf-.B bishbosh --verbosity=Deafening -i '/usr/share/bishbosh/config/Raw/bishbosh_black.xml' +RTS -N -H100M -RTS+.B bishbosh --verbosity=Deafening -i ~/.cabal/share/*/bishbosh-*/config/Raw/bishbosh_black.xml +RTS -N -H100M -RTS .fi .IP \(bu The application has been instructed to provide maximal feedback. .IP \(bu One of the packaged configuration-files has been referenced, which automates Black's moves & also references some packaged PGN-databases. .IP \(bu-For performance, the run-time system has been explicitly instructed to fully utilise the available CPU-cores to satisfy the massively parallel implementation, & to set a large minimum size for the heap to satisfy its craving for RAM; actually similar defaults have been predefined.+For performance, the run-time system has been explicitly instructed to fully utilise the available CPU-cores, & to set a large minimum size for the heap to satisfy its craving for RAM; actually similar defaults have been predefined. .PP .nf-.B xboard -fcp 'bishbosh -i /usr/share/bishbosh/config/CECP/bishbosh_black.xml'+.B xboard -fcp "bishbosh -i $HOME/.cabal/share/x86_64-linux-ghc-8.0.2/bishbosh-0.0.0.2/config/CECP/bishbosh_black.xml" .fi .IP \(bu-Instruct the \fBxboard\fR GUI to use \fBbishbosh\fR as its first engine.+Instruct the \fBxboard\fR GUI to use \fBbishbosh\fR as its first engine; \fBwinboard\fR is the equivalent GUI for \fBMS-Windows\fR.+.IP \(bu+N.B.: \fBbishbosh\fR & its arguments are delimited by double-quotes, so that they are interpreted by \fBxboard\fR as a single argument.+.IP \(bu+CAVEAT: the hard-coded architecture-specific & version-specific directories may need to be edited. .SH FILES .TS lb	lb@@ -158,7 +150,7 @@ bishbosh.svg	A module-dependency graph for this application. config/{CECP,Raw}/*.xml	Sample configuration-files. man/man5/bishbosh.5	\fBSection-5\fR of the man-pages for this product, describing the configuration-file format.-pgn/*.pgn	Sample PGN-databases; \fBhttps://en.wikipedia.org/wiki/Portable_Game_Notation\fR.+pgn/*.pgn	Sample PGN-databases; \fBhttps://en.wikipedia.org/wiki/Portable_Game_Notation\fR . ~/.bishbosh/*.txt	Persisted games, stored in a user-specific directory. https://www.gnu.org/software/xboard	A GUI for chess-engines. .TE@@ -180,7 +172,7 @@ .PP This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .PP-You should have received a copy of the GNU General Public License along with this program. If not, see \fBhttps://www.gnu.org/licenses/\fR.+You should have received a copy of the GNU General Public License along with this program. If not, see \fBhttps://www.gnu.org/licenses/\fR . .SH "SEE ALSO" .IP \(bu Home-page: \fBhttps://functionalley.eu/BishBosh/bishbosh.html\fR
man/man5/bishbosh.5 view
@@ -1,27 +1,9 @@-\" AUTHOR: Dr. Alistair Ward-\" Copyright (C) 2018 Dr. Alistair Ward-\"-\" This file is part of BishBosh.-\" -\" BishBosh is free software: you can redistribute it and/or modify-\" it under the terms of the GNU General Public License as published by-\" the Free Software Foundation, either version 3 of the License, or-\" (at your option) any later version.-\" -\" BishBosh is distributed in the hope that it will be useful,-\" but WITHOUT ANY WARRANTY; without even the implied warranty of-\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the-\" GNU General Public License for more details.-\" -\" You should have received a copy of the GNU General Public License-\" along with BishBosh.  If not, see <http://www.gnu.org/licenses/>.- .TH bishbosh 5 .SH DESCRIPTION This man-page describes the configuration of the application; its invocation is described in \fBsection-1\fR of the man-pages. .SH CONFIGURATION Configuration is read from an XML-file referenced from the command-line.-The grammar of this file is defined in "\fBconfig/bishbosh.dtd\fR" or more precisely using \fBRELAX NG\fR in "\fBconfig/bishbosh.rng\fR", but the semantics of the more important fields are described below.+The grammar of this file is defined in "\fBconfig/bishbosh.dtd\fR" or more precisely using \fBRELAX NG\fR in "\fBconfig/bishbosh.rng\fR", whereas the semantics of the more important fields is described below. .SS Options .IP \(bu \fBmaximumPlies\fR \fIInt\fR: the optional maximum number of plies (half moves) before the game is terminated.@@ -30,7 +12,7 @@ .SS Evaluation-options Each field governs automatic move-evaluation: .IP \(bu-\fBincrementalEvaluation\fR \fIBool\fR; default \fBTrue\fR.+\fBincrementalEvaluation\fR \fIBool\fR, defaulting to "\fBTrue\fR". Whether to incrementally generate position-hashes & evaluate the piece-square value, from the previous values; otherwise these quantities are evaluated from scratch. This option slightly reduces memory-requirement, but doesn't affect the result. .IP \(bu@@ -89,49 +71,50 @@ The packaged configuration-files define modified tables for both Pawn & King. .SS Search-options .IP \(bu-\fBpreferMovesTowardsCentre\fR: whether to sort moves on the magnitude of the progress towards the centre of the board.+\fBpreferMovesTowardsCentre\fR: whether to sort the moves available from any position, using the magnitude of their progress towards the centre of the board. .IP \(bu-\fBsortOnStandardOpeningMoveFrequency\fR: whether to sort moves on the frequency with which they occur in referenced standard openings.+\fBsortOnStandardOpeningMoveFrequency\fR: whether to sort the moves available from any position, using the frequency with which they occur in referenced standard openings. This is performed after \fBpreferMovesTowardsCentre\fR, but since the sort-algorithms are stable, i.e. they don't affect the order of those moves which compare equal, they can usefully be sequentially applied. .IP \(bu \fBcaptureMoveSortAlgorithm\fR: the optional algorithm by which to partition & sort capture-moves for preferential evaluation when searching for the optimum amongst available moves. If unspecified, the order of capture-moves will remain unaltered both wrt each other & wrt other moves. .br-Neither of these sort-algorithms affects the relative order of non-capture moves; cf. \fBpreferMovesTowardsCentre\fR & \fBsortOnStandardOpeningMoveFrequency\fR.-This is performed after \fBsortOnStandardOpeningMoveFrequency\fR. .TS lb	lb l	l lb	l	. Value	Meaning =====	=======-MVVLVA	moves are advanced depending on the value of rank of the piece they capture, but where this is equal, those which achieve this using a less valuable piece are preferred. This is highly effective.-SEE	moves are advanced depending on the net material gain resulting from any battle at the destination. This is not currently competitive.+MVVLVA	moves are advanced depending on the value of rank of the piece they capture, but where this is equal, those which achieve this using a less valuable piece are preferred; \fBhttps://chessprogramming.wikispaces.com/MVV-LVA\fR . This is highly effective.+SEE	moves are advanced depending on the net material gain resulting from any battle at the destination; \fBhttps://chessprogramming.wikispaces.com/Static+Exchange+Evaluation\fR . This is not currently competitive. .TE+.IP+Neither of these sort-algorithms affects the relative order of non-capture moves; cf. \fBpreferMovesTowardsCentre\fR & \fBsortOnStandardOpeningMoveFrequency\fR.+This is performed after \fBsortOnStandardOpeningMoveFrequency\fR. .IP \(bu-\fBminimumHammingDistance\fR \fIInt\fR: the optional positive lower bound on the Hamming-distance between any of the random numbers used to generate Zobrist hashes from positions.+\fBminimumHammingDistance\fR \fIInt\fR: the optional positive lower bound on the Hamming-distance between any of the random numbers used to generate Zobrist hashes from positions; \fBhttps://chessprogramming.wikispaces.com/Zobrist+Hashing\fR . .br-CAVEAT: Linear independence of the bit-vectors is a better measure than Hamming distance, of the quality of the selected random numbers.+CAVEAT: linear independence of the bit-vectors is a better measure than Hamming-distance, of the quality of the selected random numbers. .IP \(bu-\fBretireKillerMovesAfter\fR \fIInt\fR: the optional non-negative number of full moves (one by each player) after which killer-moves are retired.+\fBretireKillerMovesAfter\fR \fIInt\fR: the optional non-negative number of full moves (one by each player) after which killer-moves are retired; \fBhttps://chessprogramming.wikispaces.com/Killer+Move\fR . If unspecified, killer-moves won't even be recorded. .br N.B.: this is highly effective up to about \fB3\fR, beyond which returns diminish. .br-Killer-moves can be used to reorder the evaluation of moves, based on whether similar moves triggered beta-cutoff in sibling games.+Killer-moves are used to dynamically sort the moves available from a position, based on whether similar moves previously triggered beta-cutoff; \fBhttps://chessprogramming.wikispaces.com/Beta-Cutoff\fR . .IP \(bu-\fBtrapRepeatedPositions\fR: whether to short-circuit the fitness-evaluation of \fIposition\fRs which have been visited before in the current game.-These situations result from loops of reversible moves, in the tree of moves which defines the game of chess.+\fBtrapRepeatedPositions\fR: whether to short-circuit the fitness-evaluation of \fIposition\fRs which have been visited before in the current game; \fBhttps://chessprogramming.wikispaces.com/Repetitions\fR .+These situations result from loops of consecutive reversible moves, in the move-tree which defines the game of chess. The fitness of such \fIposition\fRs can be derived by induction, since were one to search from this \fIposition\fR, one would ultimately arrive back another time, so the fitness of this future \fIposition\fR equals the current fitness. .br N.B.: this doesn't typically improve performance in either space or time. .IP \(bu-\fBusePondering\fR: whether an automated player should plan their next move, based on a prediction of the opponent's response, & thus make use their opponent's thinking-time.+\fBusePondering\fR: whether an automated player should plan their next move, based on a prediction of the opponent's response, & thus make use their opponent's thinking-time; \fBhttps://chessprogramming.wikispaces.com/Pondering\fR . .IP \(bu \fBtranspositions\fR: these can be used to reorder the evaluation of moves,-based on the results previously found for identical \fIposition\fRs in sibling games reached by an alternative sequence of arbitrary moves.+based on the results previously found for identical \fIposition\fRs in sibling games reached by an alternative sequence of arbitrary moves; \fBhttps://chessprogramming.wikispaces.com/Transposition\fR . .TS lb	lb	lb l	l	l@@ -149,9 +132,9 @@ lb	l	lb	l	. Field	Type	Default	Meaning =========	====	=======	=======-tryToMatchMoves	Bool	True	whether to attempt to exactly match the moves already made with a standard opening; i.e. without matching transpositions.-tryToMatchViaJoiningMove	Bool	True	whether to attempt to join the current position (irrespective of the means by which it was achieved) to a standard opening that's only one ply away.-tryToMatchColourFlippedPosition	Bool	True	whether to attempt to match a colour-flipped version of the current position with a standard opening.+tryToMatchMoves	Bool	True	whether to attempt to exactly match the moves already made, with a standard opening; i.e. without matching transpositions.+tryToMatchViaJoiningMove	Bool	True	whether to attempt to join the current position (irrespective of the means by which it was achieved) to a standard opening that's only one move away.+tryToMatchColourFlippedPosition	Bool	True	whether to attempt to match a colour-flipped (\fBhttps://chessprogramming.wikispaces.com/Color+Flipping\fR) version of the current position with a standard opening. .TE .IP \(bu \fBsearchDepth\fR \fIInt\fR, defaulting to "\fB4\fR" (minimum "\fB1\fR"): the number of plies (half moves) to search ahead, when selecting the next move.@@ -165,7 +148,7 @@ .IP \(bu \fBmaximumPGNNames\fR \fIInt\fR: the optional maximum number of names, with which to annotate moves matching games from the configured PGN-databases. .IP \(bu-\fBpgnOptions\fR: these options allow one to reference PGN-databases, which the application can leverage during move-selection.+\fBpgnOptions\fR: these options allow one to reference PGN-databases, which the application can leverage during move-selection; \fBhttps://en.wikipedia.org/wiki/Portable_Game_Notation\fR . .TS lb	lb	lb	lb l	l	l	l@@ -192,11 +175,11 @@ .P "\fBioOptions\fR" has a sub-section "\fBuiOptions\fR", which defines the user-interface. .IP \(bu-\fBmoveNotation\fR (\fBCoordinate\fR|\fBICCFNumeric\fR|\fBSmith\fR), defaulting to "\fBSmith\fR": the expected syntax used to define a move.+\fBmoveNotation\fR (\fBCoordinate\fR|\fBICCFNumeric\fR|\fBSmith\fR), defaulting to "\fBSmith\fR"; \fBhttps://en.wikipedia.org/wiki/Chess_notation\fR . The expected syntax used to define a move. This application also understands \fBStandard Algebraic\fR notation, but it is only used to read the PGN-databases used to define standard openings. .IP \(bu \fBprintMoveTree\fR \fIInt\fR.-Print the tree of all possible moves in the game, truncated to the specified depth.+Print the tree of all possible moves in the configured notation, truncated to the specified depth. The forest of moves available at each node, is sequentially sorted according to; \fBpreferMovesTowardsCentre\fR, \fBsortOnStandardOpeningMoveFrequency\fR, \fBcaptureMoveSortAlgorithm\fR; since the sort-algorithm is stable, the relative order of moves which compare equal, remains unchanged. The fitness of each move, from the perspective of the player of the move, is also printed to the configured number of decimal places; see \fBnDecimalDigits\fR. See "\fB--printMoveTree\fR" in \fBsection-1\fR of the man-pages.@@ -204,8 +187,8 @@ \fBnDecimalDigits\fR \fIInt\fR, defaulting to "\fB3\fR". Defines the precision with which fractional ancillary data is displayed. .IP \(bu-\fBverbosity\fR (\fBSilent\fR|\fBNormal\fR|\fBVerbose\fR|\fBDeafening\fR), defaulting to "\fBNormal\fR": -Defines the quantity of ancillary output required. See "\fB--verbosity\fR" in \fBsection-1\fR on the man-pages.+\fBverbosity\fR (\fBSilent\fR|\fBNormal\fR|\fBVerbose\fR|\fBDeafening\fR), defaulting to "\fBNormal\fR": defines the quantity of ancillary output required.+See "\fB--verbosity\fR" in \fBsection-1\fR on the man-pages. .IP \(bu \fBboardMagnification\fR: the size-multiplier used when rendering the board. .TS@@ -214,7 +197,6 @@ lb	l	l	. Field	Type	Meaning =========	=======	=======-nRows	\fIInt\fR	The vertical magnification of the board-image. nColumns	\fIInt\fR	The horizontal magnification of the board-image. .TE .IP \(bu@@ -244,7 +226,7 @@ config/bishbosh.rng	A more sophisticated, but slower, \fBRELAX NG\fR definition of the XML-format for the configuration-file. config/{CECP,Raw}/*.xml	Sample configuration-files. man/man1/bishbosh.1	Section-1 of the man-pages for this product, describing the command-line.-pgn/*.pgn	Standard openings & archived games, described in \fBhttps://en.wikipedia.org/wiki/Portable_Game_Notation\fR.+pgn/*.pgn	Standard openings & archived games, described in \fBhttps://en.wikipedia.org/wiki/Portable_Game_Notation\fR . https://www.oasis-open.org/committees/relax-ng/tutorial-20011203.html	A \fBRELAX NG\fR tutorial. .TE .SH AUTHOR@@ -256,5 +238,5 @@ .PP This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .PP-You should have received a copy of the GNU General Public License along with this program. If not, see \fBhttp://www.gnu.org/licenses/\fR.+You should have received a copy of the GNU General Public License along with this program. If not, see \fBhttp://www.gnu.org/licenses/\fR . 
src-exe/BishBosh/Play.hs view
@@ -123,7 +123,10 @@ play randomGen options qualifiedMoveForest	= Data.Maybe.maybe ( 	return {-to IO-monad-} Data.Default.def {-game-}  ) (-	\(filePath, _) -> if System.FilePath.equalFilePath filePath $ showChar System.FilePath.pathSeparator "dev" </> "null" -- On *nix.+	\(filePath, _) -> if any (System.FilePath.equalFilePath filePath) [+		showChar System.FilePath.pathSeparator "dev" </> "null", -- On *nix.+		"nul" -- On Windows ?+	] 		then return {-to IO-monad-} Data.Default.def {-game-} 		else Control.Exception.catch ( 			do
src-exe/BishBosh/Text/Show.hs view
@@ -45,7 +45,7 @@ 	Attribute.PhysicalColour.selectGraphicsRendition True $ Attribute.PhysicalColour.mkFgColourCode Attribute.PhysicalColour.yellow  ) $ Text.ShowList.showsWarningPrefix "" --- | Show the prefix used to denote a error-message.+-- | Show the prefix used to denote an error-message. showsErrorPrefix :: ShowS showsErrorPrefix	= Attribute.PhysicalColour.bracket ( 	Attribute.PhysicalColour.selectGraphicsRendition True $ Attribute.PhysicalColour.mkFgColourCode Attribute.PhysicalColour.red
src-exe/BishBosh/UI/CECP.hs view
@@ -108,7 +108,7 @@ moveTag :: String moveTag			= "move" --- | Used in output, to qualify an draw-offer.+-- | Used in output, to qualify a draw-offer. offerTag :: String offerTag		= "offer" 
src-exe/Main.hs view
@@ -186,7 +186,7 @@ 				G.ReqArg ( 					Just . (,) Input.UIOptions.printMoveTreeTag . Just &&& Input.CommandLineOption.mkOptionsMutator . setPrintMoveTree 				) $ mkTypeString intString-			) $ showString outputString "draw the tree of all possible moves, each annotated by an evaluation of the fitness of the resulting position, truncated to the specified number of plies.",+			) $ showString outputString "draw the tree of all possible moves in the configured notation, each annotated by a fitness-evaluation for the resulting position, truncated to the specified number of plies.", 			G.Option ""	["checkPickler"] ( 				G.NoArg ( 					Nothing {-N/A-},
src-lib/BishBosh/Attribute/Rank.hs view
@@ -19,7 +19,9 @@ {- |  [@AUTHOR@]	Dr. Alistair Ward - [@DESCRIPTION@]	Defines the data-type which represents the rank of a chess-/piece/; cf. a row of the /board/.+ [@DESCRIPTION@]	Defines the data-type which represents the rank of a chess-/piece/.++ [@CAVEAT@]	This term is also commonly used to refer to a row of the board. -}  module BishBosh.Attribute.Rank(@@ -65,7 +67,7 @@ tag :: String tag	= "rank" --- | That part of the difference between chess-/piece/s which is independent of their /logical colour/.+-- | The component of a chess-/piece/ which is independent of its colour. data Rank 	= Pawn 	| Rook@@ -118,55 +120,55 @@ instance HXT.XmlPickler Rank where 	xpickle	= HXT.xpAttr tag . HXT.xpWrap (read, show) . HXT.xpTextDT . Text.XML.HXT.Arrow.Pickle.Schema.scEnum $ map show range --- | The distinct /rank/s of the constant ordered range of those /piece/s of which each side has two.+-- | The distinct /rank/s of the constant ordered range of those /piece/s of which each side has exactly two. flank :: [Rank]-flank			= [Rook, Knight, Bishop]+flank	= [Rook, Knight, Bishop]  -- | The constant list of distinct /rank/ to which a @Pawn@ may legally be promoted; though there's no point in promotion to other than @Queen@ or @Knight@. promotionProspects :: [Rank] promotionProspects	= Queen : flank --- | Constant /rank/ to which a @Pawn@ is, in the absence of instruction, promoted.+-- | The /rank/ to which a @Pawn@ is, in the absence of instruction, promoted. defaultPromotionRank :: Rank defaultPromotionRank	= Queen --- | The subset of ranks which can only move in single steps.+-- | The subset of /rank/s which can only move in single steps. plodders :: [Rank]-plodders		= [Pawn, King]+plodders	= [Pawn, King] --- | The subset of ranks which attack over a fixed range.+-- | The subset of /rank/s which attack over a fixed range. fixedAttackRange :: [Rank] fixedAttackRange	= Knight : plodders --- | The subset of ranks which (unsupported) are sufficient to force checkmate.+-- | The subset of /rank/s which lacking support, are sufficient to force checkmate. individuallySufficientMaterial :: [Rank] individuallySufficientMaterial	= [Pawn, Rook, Queen] --- | A subset of /rank/s.+-- | The /rank/s of the back row of pieces, excluding both flanks. royalty :: [Rank]-royalty		= [Queen, King]+royalty	= [Queen, King] --- | A subset of /rank/s, which excludes @ Pawn @.+-- | The distinct /rank/s of the pieces from which the back row is composed, i.e. everything except @Pawn@s. pieces :: [Rank]-pieces		= flank ++ royalty+pieces	= flank ++ royalty --- | The /rank/s of the constant ordered back row of /piece/s, including duplicates.+-- | The ordered /rank/s of the pieces from which the back row is composed, including duplicates. nobility :: [Rank] nobility	= pieces ++ reverse flank  -- | The constant ascending list of all /rank/s. range :: [Rank]-range		= [minBound .. maxBound]+range	= [minBound .. maxBound] --- | Those ranks which can be taken.+-- | Those /rank/s which can be taken. expendable :: [Rank] expendable	= Data.List.delete King range --- | The type of a function which returns a Rank's value.+-- | The type of a function which returns a /rank/'s value. type EvaluateRank rankValue	= Rank -> rankValue  {- |-	* Compares the rank-value of aggressors.+	* Given two alternative capture moves, this function compares the rank-value of the aggressors.  	* N.B.: a @King@ is always considered most valuable, regardless of the evaluation-function supplied. -}@@ -182,7 +184,7 @@ 	| rankR == King		= LT 	| otherwise		= Data.Ord.comparing evaluateRank rankL rankR --- | A number of arbitrary ranks.+-- | A number of ranks. type NRanks	= Int  -- | The constant number of distinct /rank/s.@@ -192,7 +194,7 @@ -- | A boxed array indexed by /rank/, of arbitrary values. type ByRank	= Data.Array.IArray.Array Rank --- | Array-constructor.+-- | An array-constructor. listArrayByRank :: Data.Array.IArray.IArray a e => [e] -> a Rank e listArrayByRank	= Data.Array.IArray.listArray (minBound, maxBound) 
src-lib/BishBosh/Cartesian/Coordinates.hs view
@@ -568,11 +568,11 @@ 		xDistance, yDistance	:: T.Distance 		(xDistance, yDistance)	= measureDistance minBound coordinates --- | Whether the specified squares have the same logical colour.+-- | Whether the specified squares have the same /logical colour/. areSquaresIsochromatic :: (Enum x, Enum y) => [Coordinates x y] -> Bool areSquaresIsochromatic	= uncurry (||) . (all (== minBound) &&& all (== maxBound)) . map getLogicalColourOfSquare --- | The conventional starting /coordinates/ for both @King@s.+-- | The conventional starting /coordinates/ for the @King@ of the specified /logical colour/. kingsStartingCoordinates :: (Enum x, Enum y) => Attribute.LogicalColour.LogicalColour -> Coordinates x y kingsStartingCoordinates logicalColour	= MkCoordinates { 	getX	= toEnum $ Cartesian.Abscissa.xOrigin + 4,
src-lib/BishBosh/ContextualNotation/PGN.hs view
@@ -203,7 +203,7 @@ 	getMaybeWhitePlayerName		:: Maybe Value, 	getMaybeBlackPlayerName		:: Maybe Value, 	getIdentificationTagPairs	:: [TagPair],		-- ^ Arbitrary tagged values.-	getGame				:: Model.Game.Game x y	-- ^ Defines the turn-sequence, the result.+	getGame				:: Model.Game.Game x y	-- ^ Defines the turn-sequence & the result. } deriving Eq  instance (
src-lib/BishBosh/Data/RoseTree.hs view
@@ -48,11 +48,11 @@ 	\acc -> (+ acc) . countTerminalNodes {-recurse-}  ) 0 forest --- | Returns a string which graphically represents the tree, optionally truncated to the specified depth.+-- | Returns a string which graphically represents the tree. drawTree :: (a -> String) -> Data.Tree.Tree a -> String drawTree toString	= Data.Tree.drawTree . fmap toString --- | Returns a string which graphically represents the forest, optionally truncated to the specified depth.+-- | Returns a string which graphically represents the forest. drawForest :: (a -> String) -> Data.Tree.Forest a -> String drawForest toString	= Data.Tree.drawForest . map (fmap toString) 
src-lib/BishBosh/Input/CECPFeatures.hs view
@@ -102,7 +102,7 @@ -- | Self-documentation. type Key	= String --- | Each feature-value can be either an @Int@ (also used to represent @Boolean@ values), or an arbitrary @String@.+-- | Each feature-value can be either an @Int@ (also used to represent @Bool@ values), or an arbitrary @String@. type Value	= Either Int String  -- | Self-documentation.
src-lib/BishBosh/Input/IOOptions.hs view
@@ -61,6 +61,7 @@ import qualified	BishBosh.Input.UIOptions	as Input.UIOptions import qualified	BishBosh.Property.Tree		as Property.Tree import qualified	BishBosh.Text.ShowList		as Text.ShowList+import qualified	Control.Arrow import qualified	Control.DeepSeq import qualified	Control.Exception import qualified	Data.Default@@ -205,20 +206,18 @@ 	, null pgnOptionsList			= Control.Exception.throw . Data.Exception.mkIncompatibleData . showString "Specification of " $ shows maximumPGNNamesTag " is only irrelevant when at least one PGN-database has been referenced." 	| Just maximumPGNNames	<- maybeMaximumPGNNames 	, maximumPGNNames < 0			= Control.Exception.throw . Data.Exception.mkOutOfBounds . showString "The maximum number of names, of matching PGN-games to display, can't be negative; " $ shows maximumPGNNames "."-	| not $ null duplicateFilePaths		= Control.Exception.throw . Data.Exception.mkDuplicateData . showString "BishBosh.Input.IOOptions.mkIOOptions:\tduplicate " . showString Input.PGNOptions.databaseFilePathTag . Text.ShowList.showsAssociation $ shows duplicateFilePaths "."+	| duplicateFilePaths@(_ : _)	<- map head . filter ((/= 1) . length) . ToolShed.Data.Foldable.gather $ map (System.FilePath.normalise . Input.PGNOptions.getDatabaseFilePath) pgnOptionsList+	= Control.Exception.throw . Data.Exception.mkDuplicateData . showString "BishBosh.Input.IOOptions.mkIOOptions:\tduplicate " . showString Input.PGNOptions.databaseFilePathTag . Text.ShowList.showsAssociation $ shows duplicateFilePaths "." 	| Data.Maybe.maybe False ( 		not . System.FilePath.isValid {-i.e. non-null on POSIX-} . fst {-file-path-} 	) maybePersistence			= Control.Exception.throw . Data.Exception.mkInvalidDatum . showString "BishBosh.Input.IOOptions.mkIOOptions:\tinvalid path for " $ showString persistenceTag "." 	| otherwise	= MkIOOptions {-		getMaybeOutputConfigFilePath	= maybeOutputConfigFilePath,+		getMaybeOutputConfigFilePath	= System.FilePath.normalise <$> maybeOutputConfigFilePath, 		getMaybeMaximumPGNNames		= maybeMaximumPGNNames, 		getPGNOptionsList		= pgnOptionsList,-		getMaybePersistence		= maybePersistence,+		getMaybePersistence		= Control.Arrow.first System.FilePath.normalise <$> maybePersistence, 		getUIOptions			= uiOptions 	}-	where-		duplicateFilePaths :: [System.FilePath.FilePath]-		duplicateFilePaths	= map head . filter ((/= 1) . length) . ToolShed.Data.Foldable.gather $ map Input.PGNOptions.getDatabaseFilePath pgnOptionsList  -- | The type of a function used to transform 'IOOptions'. type Transformation row column	= IOOptions row column -> IOOptions row column
src-lib/BishBosh/Input/NativeUIOptions.hs view
@@ -147,11 +147,11 @@ mkNativeUIOptions boardMagnification colourScheme 	| uncurry (||) $ ( 		(< 1) *** (< 1)-	) boardMagnification			= Control.Exception.throw . Data.Exception.mkOutOfBounds . showString "BishBosh.Input.NativeUIOptions.mkNativeUIOptions:\t" . showString boardMagnificationTag . Text.ShowList.showsAssociation $ shows boardMagnification " must both exceed zero."+	) boardMagnification	= Control.Exception.throw . Data.Exception.mkOutOfBounds . showString "BishBosh.Input.NativeUIOptions.mkNativeUIOptions:\t" . showString boardMagnificationTag . Text.ShowList.showsAssociation $ shows boardMagnification " must both exceed zero." 	| uncurry (||) $ ( 		even *** even-	) boardMagnification			= Control.Exception.throw . Data.Exception.mkInvalidDatum . showString "BishBosh.Input.NativeUIOptions.mkNativeUIOptions:\t" . showString boardMagnificationTag . Text.ShowList.showsAssociation $ shows boardMagnification " must both be odd."-	| otherwise	= MkNativeUIOptions {+	) boardMagnification	= Control.Exception.throw . Data.Exception.mkInvalidDatum . showString "BishBosh.Input.NativeUIOptions.mkNativeUIOptions:\t" . showString boardMagnificationTag . Text.ShowList.showsAssociation $ shows boardMagnification " must both be odd."+	| otherwise		= MkNativeUIOptions { 		getBoardMagnification	= boardMagnification, 		getColourScheme		= colourScheme 	}
src-lib/BishBosh/Input/PGNOptions.hs view
@@ -167,16 +167,14 @@ mkPGNOptions databaseFilePath isStrictlySequential validateMoves identificationTags minimumPlies 	| not $ System.FilePath.isValid databaseFilePath	= Control.Exception.throw . Data.Exception.mkInvalidDatum . showString "BishBosh.Input.PGNOptions.mkPGNOptions:\tinvalid " . showString databaseFilePathTag . Text.ShowList.showsAssociation $ shows databaseFilePath "." 	| any null identificationTags				= Control.Exception.throw . Data.Exception.mkNullDatum . showString "BishBosh.Input.PGNOptions.mkPGNOptions:\tno " $ shows identificationTagTag " can be null."-	| not $ null duplicateTags				= Control.Exception.throw . Data.Exception.mkDuplicateData . showString "BishBosh.Input.PGNOptions.mkPGNOptions:\tduplicate " . showString identificationTagTag . showChar 's' . Text.ShowList.showsAssociation $ shows duplicateTags "."+	| duplicateTags@(_ : _)	<- map head . filter ((/= 1) . length) $ ToolShed.Data.Foldable.gather identificationTags+	= Control.Exception.throw . Data.Exception.mkDuplicateData . showString "BishBosh.Input.PGNOptions.mkPGNOptions:\tduplicate " . showString identificationTagTag . showChar 's' . Text.ShowList.showsAssociation $ shows duplicateTags "." 	| minimumPlies < 0					= Control.Exception.throw . Data.Exception.mkOutOfBounds . showString "BishBosh.Input.PGNOptions.mkPGNOptions:\t" $ shows minimumPliesTag " can't be negative." 	| otherwise						= MkPGNOptions {-		getDatabaseFilePath	= databaseFilePath,+		getDatabaseFilePath	= System.FilePath.normalise databaseFilePath, 		getIsStrictlySequential	= isStrictlySequential, 		getValidateMoves	= validateMoves, 		getIdentificationTags	= identificationTags, 		getMinimumPlies		= minimumPlies 	}-	where-		duplicateTags :: [ContextualNotation.PGN.Tag]-		duplicateTags	= map head . filter ((/= 1) . length) $ ToolShed.Data.Foldable.gather identificationTags 
src-lib/BishBosh/Types.hs view
@@ -93,7 +93,7 @@ -- | The type of the hash used to uniquely represent a /position/. type PositionHash	= #ifdef USE_NARROW_NUMBERS-	Data.Word.Word32	-- CAVEAT: hash-collisions become almost inevitable after (sqrt bits) trials.+	Data.Word.Word32	-- CAVEAT: hash-collisions become almost inevitable after @ sqrt bits @ trials. #else 	Data.Word.Word #endif@@ -101,7 +101,7 @@ {- | 	* The preferred type by which to represent the square of the radius of a coordinate, from the centre of the board. -	* N.B. for efficiency, @ radius ^ 2 @ is measured, to avoid the need to call 'sqrt'.+	* N.B. for efficiency, @ radius ^ 2 @ is measured, to avoid the need to call @sqrt@. -} type RadiusSquared	= #ifdef USE_NARROW_NUMBERS