Update intcode processor tests
This commit is contained in:
@@ -32,6 +32,10 @@ func NewProgram(prog []int) *Program {
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Program) GetCode() []int {
|
||||
return p.code
|
||||
}
|
||||
|
||||
func (p *Program) State() int {
|
||||
return p.state
|
||||
}
|
||||
@@ -43,11 +47,8 @@ func (p *Program) Error() error {
|
||||
func (p *Program) Run() int {
|
||||
for {
|
||||
p.state = p.Step()
|
||||
switch p.state {
|
||||
case RET_ERR:
|
||||
return RET_ERR
|
||||
case RET_DONE:
|
||||
return RET_DONE
|
||||
if p.state != RET_OK {
|
||||
return p.state
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user