Heliograph.Engine 0.1.0

dotnet add package Heliograph.Engine --version 0.1.0
                    
NuGet\Install-Package Heliograph.Engine -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Heliograph.Engine" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Heliograph.Engine" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Heliograph.Engine" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Heliograph.Engine --version 0.1.0
                    
#r "nuget: Heliograph.Engine, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Heliograph.Engine@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Heliograph.Engine&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Heliograph.Engine&version=0.1.0
                    
Install as a Cake Tool

Heliograph.Engine

The rules engine for Heliograph, a board game of mirrors and light. It covers move legality, the laser trace, win detection, the named board layouts and the rule variants. It is the same engine the Heliograph server uses to referee games.

The engine is pure and deterministic. It does no I/O, uses no clock and no randomness, and depends on nothing beyond the .NET base class library. Every method takes an immutable Board and returns a new one.

Install

dotnet add package Heliograph.Engine

Targets net10.0.

A turn

A turn is one move, then the mover's laser fires. A player whose Keep is destroyed loses.

using Heliograph.Engine;
using Heliograph.Engine.Enums;

var rules = RuleSets.FixedSun;                        // or RuleSets.TurningSun
var board = BoardLayouts.For("Dawn", rules).Build();  // also "Zenith", "Dusk"
var toMove = Player.P1;

var moves = GameEngine.LegalMoves(board, toMove, rules);
board = GameEngine.ApplyMove(board, moves[0]);

var (afterLaser, outcome) = GameEngine.FireLaser(board, toMove);
var status = GameEngine.CheckWin(afterLaser);         // InProgress, P1Win or P2Win

GameEngine.ValidateMove explains why a single move is illegal. Pass the same RuleSet to LegalMoves and ValidateMove that you used to pick the layout: stacking moves exist only under FixedSun.

Versioning

The package version is set from the engine-v* tag it was published from. Bots and tools that record games should store the engine version with each game, because a rule change makes results from different versions incomparable.

Licence

MIT.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 140 11/3/2026