pietvm

package module
v0.0.0-...-5890451 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 11 Imported by: 0

README

piet-vm

interpreter / virtual machine for the piet esoteric programming language

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanMove

func CanMove(img image.Image, currentPos image.Point, dp DpDir) bool

func ColorAtPos

func ColorAtPos(img image.Image, pos image.Point) color.Color

func ColorInfo

func ColorInfo(c color.Color) (hue, lightness int)

func SameColors

func SameColors(c1, c2 color.Color) bool

Types

type CCDir

type CCDir int

type ColorBlock

type ColorBlock map[image.Point]struct{}

func GetColorBlock

func GetColorBlock(img image.Image, currentPos image.Point, currentColor color.Color) (block ColorBlock)

func (ColorBlock) Bounds

func (cb ColorBlock) Bounds() (r image.Rectangle)

func (ColorBlock) String

func (cb ColorBlock) String() string

type DpDir

type DpDir image.Point

type Interpreter

type Interpreter struct {
	Img image.Image
	Stack
	io.Writer
	io.Reader

	Logger *log.Logger
	// contains filtered or unexported fields
}

func New

func New(img image.Image) Interpreter

func (*Interpreter) Debug

func (in *Interpreter) Debug()

func (*Interpreter) DebugPrint

func (in *Interpreter) DebugPrint()

func (*Interpreter) Run

func (in *Interpreter) Run()

type Stack

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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