Fix a few mistakes in print statements

This commit is contained in:
Manuel 2023-07-21 20:48:45 +02:00
parent 4e0801eb9b
commit 3824fe27f1
Signed by: Manuel
GPG key ID: 4085037435E1F07A
2 changed files with 5 additions and 6 deletions

1
hsv.go
View file

@ -31,7 +31,6 @@ func main() {
} else if len(args) == 2 { } else if len(args) == 2 {
pxX, _ := strconv.Atoi(args[0]) pxX, _ := strconv.Atoi(args[0])
pxY, _ := strconv.Atoi(args[1]) pxY, _ := strconv.Atoi(args[1])
fmt.Println()
printPixel(pxX, pxY) printPixel(pxX, pxY)
} else { } else {
input := bufio.NewScanner(os.Stdin) input := bufio.NewScanner(os.Stdin)

View file

@ -61,7 +61,7 @@ func (val *Validator) sectionB(u int, v int, h int) {
val.print(" R → R + %d² → R + %d ⇒ R = %d", w, w*w, val.r) val.print(" R → R + %d² → R + %d ⇒ R = %d", w, w*w, val.r)
} }
var o int = s + 2200 var o int = s + 2200
val.print("o = %d + 2200", s) val.print("o = %d + 2200 = %d", s, o)
val.r = val.mod(val.r*o, 4) val.r = val.mod(val.r*o, 4)
val.print("R → R ⋅ %d | 4 ⇒ R = %d", o, val.r) val.print("R → R ⋅ %d | 4 ⇒ R = %d", o, val.r)
val.b = val.mod(val.b*o, 4) val.b = val.mod(val.b*o, 4)
@ -104,9 +104,9 @@ func (val *Validator) sectionC(u int, v int, h int) {
var r int = c + u*v var r int = c + u*v
val.print("r = %d + %d ⋅ %d = %d + %d = %d", c, u, v, c, u*v, r) val.print("r = %d + %d ⋅ %d = %d + %d = %d", c, u, v, c, u*v, r)
var d int = 3200 - h - 2*r var d int = 3200 - h - 2*r
val.print("d = 3200 - %d - 2 ⋅ %d = %d + %d = %d", h, r, 3200-h, 2*r, d) val.print("d = 3200 - %d - 2 ⋅ %d = %d - %d = %d", h, r, 3200-h, 2*r, d)
if d > 0 { if d > 0 {
val.print("⇒ c > 0 → %d > 0", d) val.print("⇒ d > 0 → %d > 0", d)
val.r = val.r + d val.r = val.r + d
val.print(" R → R + %d ⇒ R = %d", d, val.r) val.print(" R → R + %d ⇒ R = %d", d, val.r)
} }
@ -116,11 +116,11 @@ func (val *Validator) sectionC(u int, v int, h int) {
func (val *Validator) sectionD(x int, y int) { func (val *Validator) sectionD(x int, y int) {
val.print("=> Continuing to section D") val.print("=> Continuing to section D")
var c int = x + 4*y var c int = x + 4*y
val.print("c = %d + 4 ⋅ %d", x, y) val.print("c = %d + 4 ⋅ %d = %d + %d = %d", x, y, x, 4*y, c)
val.r = 132 + c val.r = 132 + c
val.print("R = 132 + %d = %d", c, val.r) val.print("R = 132 + %d = %d", c, val.r)
val.b = 192 + c val.b = 192 + c
val.print("R = 192 + %d = %d", c, val.b) val.print("B = 192 + %d = %d", c, val.b)
val.sectionE() val.sectionE()
} }