sudokurgb

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: 16 Imported by: 0

README

Sudoku RGB

Sudoku RGB is a 9x9 multiset-constraint puzzle inspired by Ripeto.

How to Play

Fill every cell with one of three values:

  • 1 =
  • 2 =
  • 3 =

The goal is for every row, every column, and every 3x3 box to contain the same multiset:

{1,1,1,2,2,2,3,3,3}

Unlike classic Sudoku, repeated values are allowed within a house up to their quota of three. A conflict appears only when a house contains more than three copies of a value.

Controls

Key Action
Arrow keys / WASD / hjkl Move cursor
Mouse left-click Focus a cell
1 / 2 / 3 Place / /
Backspace Clear cell
Ctrl+R Reset puzzle
Ctrl+H Toggle full help
Escape Return to main menu

Modes

Mode Clues Description
Beginner 60 Gentle intro to RGB quota logic
Easy 54 Early rows and boxes resolve quickly
Medium 48 Mixed row, column, and box pressure
Hard 42 More ambiguous houses and cross-checking
Expert 36 Sparse givens require deeper scanning
Diabolical 30 Tightest clue budget in the launch set

Quick Start

puzzletea new "sudoku rgb" beginner
puzzletea new ripeto medium
puzzletea new "rgb sudoku" diabolical

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKeyMap = KeyMap{
	CursorKeyMap: game.DefaultCursorKeyMap,
	FillValue: key.NewBinding(
		key.WithKeys("1", "2", "3"),
		key.WithHelp("1-3", "Fill"),
	),
	ClearCell: key.NewBinding(
		key.WithKeys("backspace"),
		key.WithHelp("bkspc", "Clear"),
	),
}
View Source
var Definition = puzzle.NewDefinition(puzzle.DefinitionSpec{
	Name:         "Sudoku RGB",
	Description:  "Fill the board with RGB symbols so each row, column, and 3x3 box contains {1,1,1,2,2,2,3,3,3}. [1,2,3] maps to [▲,■,●]. Inspired by Sudoku Ripeto.",
	Aliases:      []string{"rgb sudoku", "ripeto", "sudoku ripeto"},
	Modes:        ModeDefinitions,
	DailyModeIDs: puzzle.SelectModeIDsByIndex(ModeDefinitions, 1, 2),
})
View Source
var HelpContent string
View Source
var ModeDefinitions = gameentry.BuildModeDefs(Modes)
View Source
var Modes = []game.Mode{
	NewMode("Beginner", "60 clues. Gentle intro to RGB quota logic.", 60),
	NewMode("Easy", "54 clues. Early rows and boxes resolve quickly.", 54),
	NewMode("Medium", "48 clues. Mixed row, column, and box pressure.", 48),
	NewMode("Hard", "42 clues. More ambiguous houses and cross-checking.", 42),
	NewMode("Expert", "36 clues. Sparse givens require deeper scanning.", 36),
	NewMode("Diabolical", "30 clues. Tightest clue budget in the launch set.", 30),
}
View Source
var PDFPrintAdapter = printAdapter{}

Functions

func GenerateProvidedCells

func GenerateProvidedCells(mode SudokuRGBMode) []cell

func GenerateProvidedCellsSeeded

func GenerateProvidedCellsSeeded(mode SudokuRGBMode, rng *rand.Rand) []cell

func New

func New(mode SudokuRGBMode, provided []cell) (game.Gamer, error)

Types

type KeyMap

type KeyMap struct {
	game.CursorKeyMap
	FillValue key.Binding
	ClearCell key.Binding
}

type Model

type Model struct {
	// contains filtered or unexported fields
}

func ImportModel

func ImportModel(data []byte) (*Model, error)

func (Model) GetDebugInfo

func (m Model) GetDebugInfo() string

func (Model) GetFullHelp

func (m Model) GetFullHelp() [][]key.Binding

func (Model) GetSave

func (m Model) GetSave() ([]byte, error)

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) IsProvidedCell

func (m Model) IsProvidedCell() bool

func (Model) IsSolved

func (m Model) IsSolved() bool

func (Model) Reset

func (m Model) Reset() game.Gamer

func (Model) SetTitle

func (m Model) SetTitle(t string) game.Gamer

func (Model) Update

func (m Model) Update(msg tea.Msg) (game.Gamer, tea.Cmd)

func (Model) View

func (m Model) View() string

type Save

type Save struct {
	Grid      string       `json:"grid"`
	Provided  []exportCell `json:"provided"`
	ModeTitle string       `json:"mode_title,omitempty"`
}

type SudokuRGBMode

type SudokuRGBMode struct {
	game.BaseMode
	ProvidedCount int
}

func NewMode

func NewMode(title, description string, providedCount int) SudokuRGBMode

func (SudokuRGBMode) Spawn

func (s SudokuRGBMode) Spawn() (game.Gamer, error)

func (SudokuRGBMode) SpawnSeeded

func (s SudokuRGBMode) SpawnSeeded(rng *rand.Rand) (game.Gamer, error)

Jump to

Keyboard shortcuts

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