Added day08 instruction generator
This commit is contained in:
BIN
day08/day08
BIN
day08/day08
Binary file not shown.
@@ -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())
|
||||
}
|
||||
|
Reference in New Issue
Block a user