gridgen

package
v0.0.0-...-dfde813 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ImageSize = 28

Variables

View Source
var (
	TestFile  = path.Join(outDir, "test.dat")
	TrainFile = path.Join(outDir, "train.dat")
)

Functions

func GenerateSudokuGrid

func GenerateSudokuGrid() error

func IsCorner

func IsCorner(fragment FragmentType) bool

func IsCross

func IsCross(fragment FragmentType) bool

func IsEdge

func IsEdge(fragment FragmentType) bool

func IsEmpty

func IsEmpty(fragment FragmentType) bool

Types

type Counter

type Counter struct {
	Image
	ID int
}

type Drawer

type Drawer interface {
	Draw(images chan<- Image)
	Count() int
}

type FragmentSuperType

type FragmentSuperType uint8
const (
	FragmentSuperTypeEmpty FragmentSuperType = iota
	FragmentSuperTypeCorner
	FragmentSuperTypeEdge
	FragmentSuperTypeCross
)

func FragmentTypeToSuper

func FragmentTypeToSuper(fragment FragmentType) FragmentSuperType

type FragmentType

type FragmentType uint8
const (
	FragmentTypeEmpty FragmentType = iota
	FragmentTypeCornerNW
	FragmentTypeCornerNE
	FragmentTypeCornerSE
	FragmentTypeCornerSW
	FragmentTypeEdgeN
	FragmentTypeEdgeE
	FragmentTypeEdgeS
	FragmentTypeEdgeW
	FragmentTypeCross
)

type GridInfo

type GridInfo struct {
	Fragment      FragmentType
	FragmentSuper FragmentSuperType
	Train         bool
}

type Image

type Image struct {
	GridInfo
	Image     image.Image
	OffCenter float64
}

type Record

type Record struct {
	Pic           [ImageSize * ImageSize]uint8
	Fragment      FragmentType
	FragmentSuper FragmentSuperType
}

Jump to

Keyboard shortcuts

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