fix bugs in parse-grid.sml update functions: exit loopX and loopY if coordinate is not in range of grid

This commit is contained in:
2025-07-12 13:50:20 +01:00
parent 750246dcfd
commit d0c12d4a87
3 changed files with 3 additions and 3 deletions

BIN
dotscape

Binary file not shown.

View File

@@ -11,7 +11,7 @@ struct
local
fun loopY (yAxis, x, ex, y, ey, colour) =
if y > ey then
if y > ey orelse y >= Vector.length yAxis then
yAxis
else
let val yAxis = Vector.update (yAxis, y, colour)
@@ -19,7 +19,7 @@ struct
end
fun loopX (grid, x, ex, y, ey, colour) =
if x > ex then
if x > ex orelse x >= Vector.length grid then
grid
else
let

View File

@@ -1 +1 @@
4 4 { {0 1 0 1 0 0 0 1 } {1 2 1 2 0 0 0 1 } }
4 4 { {0 0 1 0 0 0 0 1 } {1 0 1 1 0 0 0 1 } {2 1 2 4 0 0 0 1 } {2 3 3 4 0 0 0 1 } }