Fix off-by-one

This commit is contained in:
Patrick Stevens
2021-04-03 11:51:56 +01:00
parent ed47d9f9fd
commit 8fc5f3f057

View File

@@ -29,9 +29,10 @@ module ImageOutput =
match image with
| Image arr ->
for row in arr do
for pixel in row do
writer.Write (PixelOutput.toPpm pixel)
for pixel in 0..row.Length - 2 do
writer.Write (PixelOutput.toPpm row.[pixel])
writer.Write " "
writer.Write (PixelOutput.toPpm row.[row.Length - 1])
writer.Write "\n"
progressIncrement 1.0<progress>
}