Documentation ¶
Index ¶
- Constants
- type IntCode
- func (ic *IntCode) Addr(op OpCode, i int) int
- func (ic *IntCode) Done() bool
- func (ic *IntCode) ForkWithInput(input int64) *IntCode
- func (ic *IntCode) In(inputs ...int64)
- func (ic *IntCode) InStr(input string)
- func (ic *IntCode) NextOutput() int64
- func (ic *IntCode) Out(n int) []int64
- func (ic *IntCode) OutLen() int
- func (ic *IntCode) Param(op OpCode, i int) int64
- func (ic *IntCode) Run() RunExitStatus
- func (ic *IntCode) RunToHalt() []int64
- func (ic *IntCode) String() string
- type OpCode
- type ParamMode
- type RunExitStatus
Constants ¶
View Source
const ( OpAdd = 1 OpMul = 2 OpInput = 3 OpOutput = 4 OpJnz = 5 OpJz = 6 OpLessThan = 7 OpEquals = 8 OpBase = 9 OpDone = 99 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IntCode ¶
type IntCode struct {
// contains filtered or unexported fields
}
func NewIntCode ¶
func NewIntCodeFromASCII ¶
func (*IntCode) ForkWithInput ¶
func (*IntCode) NextOutput ¶
func (*IntCode) Run ¶
func (ic *IntCode) Run() RunExitStatus
type RunExitStatus ¶
type RunExitStatus int
const ( Finished RunExitStatus = iota FinishedOpError NeedInput ProducedOutput )
Click to show internal directories.
Click to hide internal directories.