Antzy21.Games.Checkerboard
4.0.1
See the version list below for details.
dotnet add package Antzy21.Games.Checkerboard --version 4.0.1
NuGet\Install-Package Antzy21.Games.Checkerboard -Version 4.0.1
<PackageReference Include="Antzy21.Games.Checkerboard" Version="4.0.1" />
paket add Antzy21.Games.Checkerboard --version 4.0.1
#r "nuget: Antzy21.Games.Checkerboard, 4.0.1"
// Install Antzy21.Games.Checkerboard as a Cake Addin #addin nuget:?package=Antzy21.Games.Checkerboard&version=4.0.1 // Install Antzy21.Games.Checkerboard as a Cake Tool #tool nuget:?package=Antzy21.Games.Checkerboard&version=4.0.1
Checkerboard
This library is for creating, modifying and accessing a checkerboard. A checkerboard is a 2D board of squares, and games that use a checkerboard typically have pieces that are placed in the squares available. e.g. Chess and Checkers. Checkerboard is written functionally in F# and does not rely on external packages. Versions >= 3.0 are designed for memory efficiency, by storing the 2d board as a collection of binary integers.
Types and Modules
The Checkerboard library contains 5 types, each with a module to perform functions on the type.
Board
The board type is a 2D array of squares of a generic piece type. Currently restricted to 8x8, using the unsigned 64 bit int type. The piece information is stored in pieceTypeMaps, which are deciphered into pieces using the parser object, stored as part of the board.
type board<'Piece> = {hasPieceMap: uint64; pieceTypeMaps: uint64 list; parser: parser<'Piece>}
The Board module contains functions for creating a board, getting square(s) and updating a board.
Coordinates
The coordinates type is a tuple of ints.
type coordinates = int * int
Module Functions:
getFile
Returns the corresponding file (column) as a string, represented by a letter of the alphabet.
getRow
Returns the corresponding row numeric value as a string.
getName
Returns the corresponding name as a string, which is the concatenation of the file and row.
parse
Takes a string representation of a coordinate name and returns a coordinates<'Size> value.
The string must be in the format "[file][row]", where the file is a letter of the alphabet and the row is a number.
tryParse
Converts the string representation of some coordinates into a coordinates type.
The return value is some optional coordinates.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- Antzy21.FSharp.Extensions (>= 1.1.4)
- FSharp.Core (>= 8.0.100)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Performance update