sandbox

package
v0.0.0-...-f44a30d Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Direction

type Direction int
const (
	Left Direction = iota
	Right
	Up
	Down
	Undef
)

type NewState

type NewState struct {
	Operation StateChange
	Dir       Direction
	Meta      string
}

type Node

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

func AddNode

func AddNode(program string, meta string) *Node

func (*Node) Halt

func (n *Node) Halt() <-chan struct{}

Kill the thread - returns a channel which will be fulfilled when the thread is dead

func (*Node) Update

func (n *Node) Update(state WorldState) (<-chan NewState, bool)

type StateChange

type StateChange int
const (
	Move StateChange = iota
	Split
	Wait
	Spawn
)

type WorldState

type WorldState struct {
	Lighting map[Direction]float64
	Energy   int
	Age      int
}

Jump to

Keyboard shortcuts

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