2019 Day13 Done, just waiting for it to finish. :)

This commit is contained in:
2019-12-13 07:44:05 -06:00
parent bb20738fcc
commit c06abb613c
3 changed files with 193 additions and 7 deletions

View File

@@ -30,7 +30,6 @@ func main() {
fmt.Println("Day 5, part 1: Input '1'")
fmt.Println("Day 5, part 2: Input '5'")
p := intcode.NewProgram(prog)
go p.Run()
go func() {
for {
if st := p.State(); st != intcode.RET_OK {
@@ -51,13 +50,16 @@ func main() {
}
}
if p.NeedsOutput() {
out := p.Output()
fmt.Println(out)
fmt.Println(p.Output())
}
time.Sleep(50)
switch p.State() {
case intcode.RET_ERR:
panic(p.Error())
case intcode.RET_DONE:
break
}
time.Sleep(1)
}
}()
for {
time.Sleep(time.Second)
}
p.Run()
}