computer

package
v0.0.0-...-5c91dba Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Computer

type Computer struct {
	Input             chan Msg
	Name              string
	Output            chan Msg
	IsHalted          bool
	IsWaitingForInput bool
	IsReadyForOutput  bool
	// contains filtered or unexported fields
}

Computer defines a new computer

func NewComputerWithName

func NewComputerWithName(name string, code []int) Computer

NewComputerWithName creates a new computer with a name

func (*Computer) GetLastOutput

func (c *Computer) GetLastOutput() int

GetLastOutput gets the last output by this computer

func (*Computer) Run

func (c *Computer) Run()

Run runs the computer

type Msg

type Msg struct {
	Sender string
	Data   int
}

Msg defines the message structure used by this computer

Jump to

Keyboard shortcuts

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