Making day 9 look nicer
This commit is contained in:
parent
a896f40ab5
commit
c145e23c83
@ -27,10 +27,10 @@ func main() {
|
|||||||
for _, v := range strings.Split(stringDat, ",") {
|
for _, v := range strings.Split(stringDat, ",") {
|
||||||
prog = append(prog, helpers.Atoi(v))
|
prog = append(prog, helpers.Atoi(v))
|
||||||
}
|
}
|
||||||
part1(prog)
|
solve(prog)
|
||||||
}
|
}
|
||||||
|
|
||||||
func part1(inp []int) {
|
func solve(inp []int) {
|
||||||
p := intcode.NewProgram(inp)
|
p := intcode.NewProgram(inp)
|
||||||
//p.EnableDebug()
|
//p.EnableDebug()
|
||||||
go p.Run()
|
go p.Run()
|
||||||
@ -39,7 +39,7 @@ func part1(inp []int) {
|
|||||||
panic(p.Error())
|
panic(p.Error())
|
||||||
}
|
}
|
||||||
if p.NeedsInput() {
|
if p.NeedsInput() {
|
||||||
fmt.Print("Requesting Input: ")
|
fmt.Print("Input ('1' for part 1, '2' for part 2): ")
|
||||||
reader := bufio.NewReader(os.Stdin)
|
reader := bufio.NewReader(os.Stdin)
|
||||||
inp, err := reader.ReadString('\n')
|
inp, err := reader.ReadString('\n')
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user