Rulealize.Plugin.Grid
1.2.0
dotnet add package Rulealize.Plugin.Grid --version 1.2.0
NuGet\Install-Package Rulealize.Plugin.Grid -Version 1.2.0
<PackageReference Include="Rulealize.Plugin.Grid" Version="1.2.0" />
<PackageVersion Include="Rulealize.Plugin.Grid" Version="1.2.0" />
<PackageReference Include="Rulealize.Plugin.Grid" />
paket add Rulealize.Plugin.Grid --version 1.2.0
#r "nuget: Rulealize.Plugin.Grid, 1.2.0"
#:package Rulealize.Plugin.Grid@1.2.0
#addin nuget:?package=Rulealize.Plugin.Grid&version=1.2.0
#tool nuget:?package=Rulealize.Plugin.Grid&version=1.2.0
Rulealize.Plugin.Grid
Two-dimensional boards, coordinates, directions and ray traversal for Rulealize rule sets.
| Plugin id | Rulealize.Plugin.Grid |
| Namespace | grid |
| Reserved prefix | none |
| Depends on | Rulealize.Abstraction |
| Specification | doc/specification.md |
grid.board and grid.square are schema nodes; grid.at, coords, cells, ray,
directions, run, with and withMany are expressions; grid.set and grid.setMany are
effects. The only plugin in the standard set that provides all three kinds of node.
There is no Reversi in here. Capturing and flipping are not concepts this plugin has; a rule set assembles them out of a ray and a take-while. Whether that boundary holds is the test of whether the plugin decomposition works at all, and the same vocabulary should describe five-in-a-row, draughts, or a cellular automaton. Chess and shogi would need another plugin for captured pieces and promotion, not a bigger grid.
Two decisions to know before reading the specification. Reads are forgiving and writes
are strict: grid.at answers null three different ways — an empty square, a square off
the board, a null coordinate — and that collapse is what keeps Reversi's capture rule free
of bounds checks, while grid.set refuses both null and off-board coordinates because a
rule quietly writing nowhere is a rule that is wrong. And a board's JSON form is a sparse
object, decided here rather than by the state plugin, which moves the value in and out of
a field without looking inside it.
How the effects write
grid.set is handed "$board" as its target, which builds into a node owned by the state
plugin — an assembly this one does not reference. What makes the write possible is
IStateLocation, the contract in Rulealize.Abstraction that both plugins already depend
on. Asking the target for it yields a resolved state path, and the schema at that path is
checked at the same time, so pointing grid.set at a counter is a build error rather than
a surprise.
Building
dotnet build. Rulealize.Abstraction restores from nuget.org like any other package, so
this repository builds on its own.
License
Apache-2.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Rulealize.Abstraction (>= 0.4.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.