simulation

package
v0.0.0-...-05ea7f1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const MaxCharge = 6

Variables

This section is empty.

Functions

This section is empty.

Types

type Circuit

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

func (*Circuit) Wires

func (c *Circuit) Wires() []*Wire

type Simulation

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

func New

func New(img *image.Paletted) *Simulation

func (*Simulation) Circuit

func (s *Simulation) Circuit() *Circuit

func (*Simulation) DiffDraw

func (s *Simulation) DiffDraw(previousSimulation *Simulation, img *image.Paletted)

func (*Simulation) Draw

func (s *Simulation) Draw(img *image.Paletted)

func (*Simulation) DrawAll

func (s *Simulation) DrawAll(initialImage *image.Paletted, frameCount int) []*image.Paletted

func (*Simulation) FindLooping

func (s *Simulation) FindLooping() (*Simulation, int)

func (*Simulation) Hash

func (s *Simulation) Hash() []byte

func (*Simulation) State

func (s *Simulation) State(wire *Wire) WireState

func (*Simulation) Step

func (s *Simulation) Step() *Simulation

type Transistor

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

func (*Transistor) Base

func (t *Transistor) Base() *Wire

func (*Transistor) InputA

func (t *Transistor) InputA() *Wire

func (*Transistor) InputB

func (t *Transistor) InputB() *Wire

func (*Transistor) Position

func (t *Transistor) Position() image.Point

type Wire

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

func (*Wire) Bounds

func (w *Wire) Bounds() image.Rectangle

func (*Wire) IsPowerSource

func (w *Wire) IsPowerSource() bool

func (*Wire) Pixels

func (w *Wire) Pixels() []image.Point

func (*Wire) Transistors

func (w *Wire) Transistors() []*Transistor

type WireState

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

func (WireState) Charge

func (w WireState) Charge() uint8

func (WireState) Wire

func (w WireState) Wire() *Wire

Jump to

Keyboard shortcuts

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