2019 Day13 Done, just waiting for it to finish. :)
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
Reference in New Issue
Block a user