From 3824fe27f1f797054e828ae7820721124d83c328 Mon Sep 17 00:00:00 2001 From: Manuel Date: Fri, 21 Jul 2023 20:48:45 +0200 Subject: [PATCH] Fix a few mistakes in print statements --- hsv.go | 1 - validator/validator.go | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hsv.go b/hsv.go index aeeb926..84fe43e 100644 --- a/hsv.go +++ b/hsv.go @@ -31,7 +31,6 @@ func main() { } else if len(args) == 2 { pxX, _ := strconv.Atoi(args[0]) pxY, _ := strconv.Atoi(args[1]) - fmt.Println() printPixel(pxX, pxY) } else { input := bufio.NewScanner(os.Stdin) diff --git a/validator/validator.go b/validator/validator.go index fd55acb..f5f6dd1 100644 --- a/validator/validator.go +++ b/validator/validator.go @@ -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) } 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.print("R → R ⋅ %d | 4 ⇒ R = %d", o, val.r) 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 val.print("r = %d + %d ⋅ %d = %d + %d = %d", c, u, v, c, u*v, 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 { - val.print("⇒ c > 0 → %d > 0", d) + val.print("⇒ d > 0 → %d > 0", d) val.r = val.r + d 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) { val.print("=> Continuing to section D") 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.print("R = 132 + %d = %d", c, val.r) val.b = 192 + c - val.print("R = 192 + %d = %d", c, val.b) + val.print("B = 192 + %d = %d", c, val.b) val.sectionE() }