yao

package
v0.0.0-...-92c2bac Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GuaMap = map[Pair]int{
	{writes[0], writes[0]}: 0,
	{writes[7], writes[7]}: 1,
	{writes[3], writes[5]}: 2,
	{writes[5], writes[6]}: 3,
	{writes[0], writes[5]}: 4,
	{writes[5], writes[0]}: 5,
	{writes[5], writes[7]}: 6,
	{writes[7], writes[5]}: 7,
	{writes[0], writes[4]}: 8,
	{writes[1], writes[0]}: 9,
	{writes[0], writes[7]}: 10,
	{writes[7], writes[0]}: 11,
	{writes[2], writes[0]}: 12,
	{writes[0], writes[2]}: 13,
	{writes[6], writes[7]}: 14,
	{writes[7], writes[3]}: 15,
	{writes[3], writes[1]}: 16,
	{writes[4], writes[6]}: 17,
	{writes[1], writes[7]}: 18,
	{writes[7], writes[4]}: 19,
	{writes[3], writes[2]}: 20,
	{writes[2], writes[6]}: 21,
	{writes[7], writes[6]}: 22,
	{writes[3], writes[7]}: 23,
	{writes[3], writes[0]}: 24,
	{writes[0], writes[6]}: 25,
	{writes[3], writes[6]}: 26,
	{writes[4], writes[1]}: 27,
	{writes[5], writes[5]}: 28,
	{writes[2], writes[2]}: 29,
	{writes[6], writes[1]}: 30,
	{writes[4], writes[3]}: 31,
	{writes[6], writes[0]}: 32,
	{writes[0], writes[3]}: 33,
	{writes[7], writes[2]}: 34,
	{writes[2], writes[7]}: 35,
	{writes[2], writes[4]}: 36,
	{writes[1], writes[2]}: 37,
	{writes[6], writes[5]}: 38,
	{writes[5], writes[3]}: 39,
	{writes[1], writes[6]}: 40,
	{writes[3], writes[4]}: 41,
	{writes[0], writes[1]}: 42,
	{writes[4], writes[0]}: 43,
	{writes[7], writes[1]}: 44,
	{writes[4], writes[7]}: 45,
	{writes[5], writes[1]}: 46,
	{writes[4], writes[5]}: 47,
	{writes[2], writes[1]}: 48,
	{writes[4], writes[2]}: 49,
	{writes[3], writes[3]}: 50,
	{writes[6], writes[6]}: 51,
	{writes[6], writes[4]}: 52,
	{writes[1], writes[3]}: 53,
	{writes[2], writes[3]}: 54,
	{writes[6], writes[2]}: 55,
	{writes[4], writes[4]}: 56,
	{writes[1], writes[1]}: 57,
	{writes[5], writes[4]}: 58,
	{writes[1], writes[5]}: 59,
	{writes[1], writes[4]}: 60,
	{writes[6], writes[3]}: 61,
	{writes[2], writes[5]}: 62,
	{writes[5], writes[2]}: 63,
}

Functions

func GetGuaName

func GetGuaName(u uint8) string

func GetItemOFGua

func GetItemOFGua(p Pair) int

func GetName

func GetName(u uint8) string

Types

type Gua

type Gua struct {
	// nowtime 调用时取即可
	// 用户数据的象征,作为其中一个种子
	Seed uint64
	//本卦
	//数字用来记录卦的阴阳,定义0为阳,1为阴
	//一爻为三数,最大为1+1+1,最小为0+0+0
	//则0为老阳,1为少阴,2为少阳.3为老阴
	Inward [6]uint8
	//变卦
	//老阳与老阴变换
	//结果再减去1,用于对应标准
	//最后应该只存在0,1
	//0对应 -- ,1对应 - -
	Range [6]uint8
	//变卦数量
	RangeNum int
}

func NewGua

func NewGua(seed uint64) *Gua

func (*Gua) Changes

func (g *Gua) Changes()

变卦

func (*Gua) Divination

func (g *Gua) Divination(id int)

起卦

func (*Gua) GetInward

func (g *Gua) GetInward() string

获取本卦输出

func (*Gua) GetManifestation

func (g *Gua) GetManifestation() Pair

func (*Gua) GetRange

func (g *Gua) GetRange() string

获取变卦输出

type Pair

type Pair struct {
	A uint8
	B uint8
}

Jump to

Keyboard shortcuts

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