colormap

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Empty byte = iota + 48
	Light
	Medium
	Dark
	Full
)

These are the possible states a block can be in This should eventually read from a file, but is hard coded for now

Variables

This section is empty.

Functions

func AssignStateToNode

func AssignStateToNode(xPos int, yPos int, nodeState byte, NodeMap [][]*node)

func DefineNode

func DefineNode(nodeToDefine *node)

func GenerateNodeMap

func GenerateNodeMap(rules []*RuleNode, nodeMap [][]*node, undefinedLocations []*location)

func GetAdjacentNodePositions

func GetAdjacentNodePositions(xPos int, yPos int) [][]int

func GetLegalAdjacencies

func GetLegalAdjacencies(rules []*RuleNode, state byte) []byte

Get the possible adjacent states given a state

func GetNodeState

func GetNodeState(xPos int, yPos int, NodeMap [][]*node) byte

func InitializeNodeMap

func InitializeNodeMap(width int, height int) [][]*node

func InitializePropagationStructure

func InitializePropagationStructure(nodeMap [][]*node) []*location

func IsPositionCollapsed

func IsPositionCollapsed(xPos int, yPos int, NodeMap [][]*node) bool

Checks if the possibilities for a node have collapsed to a single state

func PrintNodeMap

func PrintNodeMap(NodeMap [][]*node)

func Propagate

func Propagate(rules []*RuleNode, nodeMap [][]*node, undefinedLocations []*location, locationsToPropagate []*location) ([]*location, []*location)

func RemoveStatePossibility

func RemoveStatePossibility(xPos int, yPos int, nodeState byte, NodeMap [][]*node)

func UpdatePossibilities

func UpdatePossibilities(rules []*RuleNode, nodeMap [][]*node, mutatedLocation *location, currentLocation *location) bool

Remove illegal states given a mutated adjacent node Returns whether or not possibility space was updated for proper propagation

Types

type RuleNode

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

Vertex in graph based ruleset

func InitRuleset

func InitRuleset() []*RuleNode

Initialize hardcoded ruleset

Jump to

Keyboard shortcuts

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