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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user