Documentation
¶
Index ¶
- Constants
- func AssignStateToNode(xPos int, yPos int, nodeState byte, NodeMap [][]*node)
- func DefineNode(nodeToDefine *node)
- func GenerateNodeMap(rules []*RuleNode, nodeMap [][]*node, undefinedLocations []*location)
- func GetAdjacentNodePositions(xPos int, yPos int) [][]int
- func GetLegalAdjacencies(rules []*RuleNode, state byte) []byte
- func GetNodeState(xPos int, yPos int, NodeMap [][]*node) byte
- func InitializeNodeMap(width int, height int) [][]*node
- func InitializePropagationStructure(nodeMap [][]*node) []*location
- func IsPositionCollapsed(xPos int, yPos int, NodeMap [][]*node) bool
- func PrintNodeMap(NodeMap [][]*node)
- func Propagate(rules []*RuleNode, nodeMap [][]*node, undefinedLocations []*location, ...) ([]*location, []*location)
- func RemoveStatePossibility(xPos int, yPos int, nodeState byte, NodeMap [][]*node)
- func UpdatePossibilities(rules []*RuleNode, nodeMap [][]*node, mutatedLocation *location, ...) bool
- type RuleNode
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 DefineNode ¶
func DefineNode(nodeToDefine *node)
func GenerateNodeMap ¶
func GenerateNodeMap(rules []*RuleNode, nodeMap [][]*node, undefinedLocations []*location)
func GetLegalAdjacencies ¶
Get the possible adjacent states given a state
func GetNodeState ¶
func InitializeNodeMap ¶
func InitializePropagationStructure ¶
func InitializePropagationStructure(nodeMap [][]*node) []*location
func IsPositionCollapsed ¶
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 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 ¶
Click to show internal directories.
Click to hide internal directories.