fix bug regarding squares not updating properly, and remove debugging code for that functionality

This commit is contained in:
2025-07-06 15:54:08 +01:00
parent bba293d406
commit 6a6a36a277

View File

@@ -2,24 +2,6 @@ structure AppWith =
struct
open AppType
fun toList vec = Vector.foldr (fn (el, acc) => el :: acc) [] vec
fun squaresToString squares =
let
val vec =
Vector.map (fn vec =>
let
val vec = Vector.map (fn num => Int.toString num) vec
val vec: string list = toList vec
in
String.concat vec
end
) squares
val vec = toList vec
in
String.concatWith "\n" vec
end
fun addSquare (app, newX, newY, arrowX, arrowY) : app_type =
let
val
@@ -46,7 +28,6 @@ struct
, modalNum
} = app
val () = print "adding new square\n"
val squares =
Vector.mapi
(fn (idx, el) =>
@@ -54,9 +35,6 @@ struct
Vector.mapi (fn (iidx, iel) => if iidx = newY then 1 else iel) el
else
el) squares
val msg = squaresToString squares
val () = print (msg ^ "\n")
in
{ mode = mode
, squares = squares