takuzuplus

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

README

Takuzu+

Fill the grid with two symbols while obeying the normal Takuzu rules plus fixed relation clues.

How to Play

Fill every empty cell with either a filled circle (●) or an open circle (○) so that the grid satisfies the standard Takuzu constraints and the relation clues placed between neighboring cells.

  1. No triples: No three consecutive identical symbols in any row or column.
  2. Equal count: Each row and column must contain exactly half ● and half ○.
  3. Unique lines: No two rows may be identical; no two columns may be identical.
  4. Relation clues: = means the two cells must match. x means they must differ.

Pre-filled cells and relation clues are fixed. The puzzle is solved when every cell is filled and all four rules are satisfied.

Controls

Key Action
Arrow keys / WASD / hjkl Move cursor
Mouse left-click Move to a cell, or cycle the current editable cell
z / 0 Place ●
x / 1 Place ○
Backspace Clear cell
Ctrl+R Reset puzzle
Ctrl+H Toggle full help
Escape Return to main menu

Modes

Mode Grid Clues Notes
Beginner 6x6 ~50% Relation clues heavily support early deduction
Easy 6x6 ~40% Balanced Takuzu and relation clue logic
Medium 8x8 ~40% Mixed deductions across rows, columns, and clues
Tricky 10x10 ~38% Uniqueness and clue interactions matter
Hard 10x10 ~32% Longer deduction chains
Very Hard 12x12 ~30% Sparse givens with tighter clue reading
Extreme 14x14 ~28% Largest board and deepest logic

Quick Start

puzzletea new takuzu-plus beginner
puzzletea new takuzu-plus medium
puzzletea new takuzu-plus extreme
puzzletea new binario+ hard       # alias

Documentation

Overview

Package takuzuplus implements the Takuzu+ puzzle game.

Index

Constants

This section is empty.

Variables

View Source
var DefaultKeyMap = KeyMap{
	CursorKeyMap: game.DefaultCursorKeyMap,
	PlaceZero: key.NewBinding(
		key.WithKeys("z", "0"),
		key.WithHelp("z/0", "Place ●"),
	),
	PlaceOne: key.NewBinding(
		key.WithKeys("x", "1"),
		key.WithHelp("x/1", "Place ○"),
	),
	Clear: key.NewBinding(
		key.WithKeys("backspace", "delete"),
		key.WithHelp("bkspc", "Clear"),
	),
}
View Source
var Definition = puzzle.NewDefinition(puzzle.DefinitionSpec{
	Name:         "Takuzu+",
	Description:  "Fill the grid with ● and ○ using some relational clues. No 3 in a row.",
	Aliases:      []string{"takuzu plus", "binario+", "binario plus"},
	Modes:        ModeDefinitions,
	DailyModeIDs: puzzle.SelectModeIDsByIndex(ModeDefinitions, 2, 3),
})
View Source
var HelpContent string
View Source
var ModeDefinitions = gameentry.BuildModeDefs(Modes)
View Source
var Modes = []game.Mode{
	NewMode("Beginner", "6×6 grid, relation clues ease early logic.", 6, 0.50, modeProfiles[0]),
	NewMode("Easy", "6×6 grid with additive = and x clues.", 6, 0.40, modeProfiles[1]),
	NewMode("Medium", "8×8 grid, mixed Takuzu and relation deductions.", 8, 0.40, modeProfiles[2]),
	NewMode("Tricky", "10×10 grid, uniqueness and relation clues interact.", 10, 0.38, modeProfiles[3]),
	NewMode("Hard", "10×10 grid, longer deduction chains with relation clues.", 10, 0.32, modeProfiles[4]),
	NewMode("Very Hard", "12×12 grid, sparse givens plus relation clues.", 12, 0.30, modeProfiles[5]),
	NewMode("Extreme", "14×14 grid, maximum size with additive relation clues.", 14, 0.28, modeProfiles[6]),
}
View Source
var PDFPrintAdapter = printAdapter{}

Functions

func New

func New(mode TakuzuPlusMode, puzzle grid, provided [][]bool, rels relations) (game.Gamer, error)

Types

type KeyMap

type KeyMap struct {
	game.CursorKeyMap
	PlaceZero key.Binding
	PlaceOne  key.Binding
	Clear     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) 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 {
	Size                int    `json:"size"`
	State               string `json:"state"`
	Provided            string `json:"provided"`
	ModeTitle           string `json:"mode_title"`
	HorizontalRelations string `json:"horizontal_relations"`
	VerticalRelations   string `json:"vertical_relations"`
}

type TakuzuPlusMode

type TakuzuPlusMode struct {
	game.BaseMode
	Size      int
	Prefilled float64
	// contains filtered or unexported fields
}

func NewMode

func NewMode(title, desc string, size int, prefilled float64, profile relationProfile) TakuzuPlusMode

func (TakuzuPlusMode) Spawn

func (t TakuzuPlusMode) Spawn() (game.Gamer, error)

func (TakuzuPlusMode) SpawnSeeded

func (t TakuzuPlusMode) 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