fix bug regarding squares not updating properly, and remove debugging code for that functionality
This commit is contained in:
@@ -2,24 +2,6 @@ structure AppWith =
|
|||||||
struct
|
struct
|
||||||
open AppType
|
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 =
|
fun addSquare (app, newX, newY, arrowX, arrowY) : app_type =
|
||||||
let
|
let
|
||||||
val
|
val
|
||||||
@@ -46,7 +28,6 @@ struct
|
|||||||
, modalNum
|
, modalNum
|
||||||
} = app
|
} = app
|
||||||
|
|
||||||
val () = print "adding new square\n"
|
|
||||||
val squares =
|
val squares =
|
||||||
Vector.mapi
|
Vector.mapi
|
||||||
(fn (idx, el) =>
|
(fn (idx, el) =>
|
||||||
@@ -54,9 +35,6 @@ struct
|
|||||||
Vector.mapi (fn (iidx, iel) => if iidx = newY then 1 else iel) el
|
Vector.mapi (fn (iidx, iel) => if iidx = newY then 1 else iel) el
|
||||||
else
|
else
|
||||||
el) squares
|
el) squares
|
||||||
|
|
||||||
val msg = squaresToString squares
|
|
||||||
val () = print (msg ^ "\n")
|
|
||||||
in
|
in
|
||||||
{ mode = mode
|
{ mode = mode
|
||||||
, squares = squares
|
, squares = squares
|
||||||
|
|||||||
Reference in New Issue
Block a user