Fix a few mistakes in print statements
This commit is contained in:
parent
4e0801eb9b
commit
3824fe27f1
2 changed files with 5 additions and 6 deletions
1
hsv.go
1
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)
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue