EluciusFTW.Tui48 0.1.4

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

EluciusFTW.Tui48

A 2048-style sliding tile game 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.

Slide the tiles with the arrow keys (or h j k l); equal tiles merge and add to your score. Reach the 2048 tile to win, then keep going if you like. Boards from 3x3 to 6x6 (keys 3–6), with the best score per board size kept.

Based on the original 2048 by Gabriele Cirulli.

Hosting the component

open Tui48

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

let init () = Tui48.init deps

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

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

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

When embedding, wrap the component's messages in your own (TileMsg of Tui48.Msg), route key presses to it as Tui48.InputMsg key, render Tui48.view on top of your view, and decide what Closed means, e.g. hiding the overlay instead of exiting. Keep the cmd returned along with Closed: it saves a new highscore of the game in progress.

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.4 103 10/23/2026
0.1.3 103 10/23/2026