Added day08 instruction generator

This commit is contained in:
2016-12-08 14:43:58 -06:00
parent bd285a71c4
commit 39d8900ccf
4 changed files with 667 additions and 11 deletions

Binary file not shown.

View File

@@ -11,26 +11,24 @@ import (
"time"
)
// First guess: 95 (too low)
func main() {
if len(os.Args) < 3 {
fmt.Println("Expected Display Width & Height as Arguments")
width := 50
height := 6
if len(os.Args) >= 2 {
width = atoi(os.Args[1])
}
if len(os.Args) >= 3 {
height = atoi(os.Args[2])
}
input := stdinToStringSlice()
// Test Display:
// d := CreateDisplay(7, 3)
// Prod Display:
// d := CreateDisplay(50, 6)
width := atoi(os.Args[1])
height := atoi(os.Args[2])
d := CreateDisplay(width, height)
for idx, ins := range input {
fmt.Println(idx, ins)
d.ClearScreen()
d.ProcInstruction(ins)
d.PrintScreen()
time.Sleep(time.Millisecond * 75)
time.Sleep(time.Millisecond * 25)
}
fmt.Println("Voltage Used: ", d.GetVoltage())
}