func (m *Matrix) init() {
	for w := 0; w < m.width; w++ {
		for h := 0; h < m.height; h++ {
			m.mat[w][h] = StateInit
		}
	}
}
do some init work
package matrix
import (
	"errors"
	"fmt"
)
type ScanDirection uint
const (
	ROW ScanDirection = 1
	COLUMN ScanDirection = 2
)
type State uint16
const (
	StateFalse State = 0xffff
	ZERO State = 0xeeee
	StateTrue State = 0x0
	StateInit State = 0x9999
	StateVersion State = 0x4444
	StateFormat State = 0x7777
	StateFinder State = 0x8000
)
func (s State) String() string {
	return fmt.Sprintf("0x%X", uint16(s))
}
var (
	ErrorOutRangeOfW = errors.New("out of range of width")
	ErrorOutRangeOfH = errors.New("out of range of height")
)
func StateSliceMatched(ss1, ss2 []State) bool {
	if len(ss1) != len(ss2) {
		return false
	}
	for idx := range ss1 {
		if (ss1[idx] ^ ss2[idx]) != 0 {
			return false
		}
	}
	return true
}
func New(width, height int) *Matrix {
	mat := make([][]State, width)
	for w := 0; w < width; w++ {
		mat[w] = make([]State, height)
	}
	m := &Matrix{
		mat:    mat,
		width:  width,
		height: height,
	}
	m.init()
	return m
}
type Matrix struct {
	mat    [][]State
	width  int
	height int
}