EluciusFTW.Tuisweeper 0.1.3

dotnet add package EluciusFTW.Tuisweeper --version 0.1.3
                    
NuGet\Install-Package EluciusFTW.Tuisweeper -Version 0.1.3
                    
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="EluciusFTW.Tuisweeper" Version="0.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EluciusFTW.Tuisweeper" Version="0.1.3" />
                    
Directory.Packages.props
<PackageReference Include="EluciusFTW.Tuisweeper" />
                    
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 EluciusFTW.Tuisweeper --version 0.1.3
                    
#r "nuget: EluciusFTW.Tuisweeper, 0.1.3"
                    
#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 EluciusFTW.Tuisweeper@0.1.3
                    
#: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=EluciusFTW.Tuisweeper&version=0.1.3
                    
Install as a Cake Addin
#tool nuget:?package=EluciusFTW.Tuisweeper&version=0.1.3
                    
Install as a Cake Tool

EluciusFTW.Tuisweeper

Minesweeper as an Elmish component for SpectreTuff.Elmish programs. Host it as a whole app, or embed it in your own, for example as a pop-up game.

Hosting the component

open Tuisweeper

// Highscores: Store.defaultFile (shared with the standalone game), Store.file path,
// Store.none, or your own { Load = ...; Save = ... }.
let deps = Tuisweeper.Dependencies.create Highscore.Store.defaultFile

let init () = Tuisweeper.init deps

let update msg model =
  let model, cmd, out = Tuisweeper.update deps msg model

  match out with
  | Some Tuisweeper.Closed -> model, Cmd.batch [ cmd; TuiCmd.exit ] // the player pressed q or Esc
  | None -> model, cmd

Elmish.Program.mkProgram init update Tuisweeper.view
|> Elmish.Program.withSubscription (fun model ->
  Subscriptions.keys Tuisweeper.InputMsg @ Tuisweeper.subscriptions model)
|> Tui.run

When embedding, wrap the component's messages in your own (SweeperMsg of Tuisweeper.Msg), route key presses to it as Tuisweeper.InputMsg key, render Tuisweeper.view on top of your view, and decide what Closed means, e.g. hiding the overlay instead of exiting.

See src/Tuigames.Cli in this repository for a host that embeds this and other games behind a menu.

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.

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.3 103 10/23/2026
0.1.1 97 10/23/2026