resolve

package
v1.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mode

func Mode(entry registry.Entry, name string) (game.Spawner, string, error)

Mode finds a mode within a game entry by name. If name is empty, returns the first (default) mode.

func ModeNames

func ModeNames(entry registry.Entry) []string

ModeNames returns the display names of all modes in an entry.

func Normalize

func Normalize(s string) string

Normalize lowercases and replaces hyphens/underscores with spaces for fuzzy matching of CLI arguments to mode names.

func RNGFromString added in v1.5.0

func RNGFromString(seed string) *rand.Rand

RNGFromString creates a deterministic RNG seeded from an arbitrary string. The string is hashed with FNV-64a to produce a uint64 seed.

func SeededMode added in v1.5.0

func SeededMode(seed string, entries []registry.Entry) (game.SeededSpawner, string, string, error)

SeededMode selects a game type and mode from all available modes across all categories using rendezvous hashing (highest random weight). Each eligible mode is scored by hashing the seed string together with its (gameType, modeTitle) pair; the highest score wins.

This is resilient to changes in the category/mode lists: adding or removing a mode only affects seeds where the changed entry would have been the winner.

func SeededModeForGame added in v1.8.0

func SeededModeForGame(seed, gameType string, entries []registry.Entry) (game.SeededSpawner, string, string, error)

SeededModeForGame deterministically selects a seeded mode within a single game definition, so the same seed and game name always produce the same puzzle for that game.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL