rip out print statements which were solely for debugging

This commit is contained in:
2025-01-21 22:46:04 +00:00
parent 72924ae084
commit 282d72b840
3 changed files with 217 additions and 233 deletions

View File

@@ -740,18 +740,12 @@ struct
fun canJumpOnPlatform (player, platforms, enemy: enemy, platformTree) = fun canJumpOnPlatform (player, platforms, enemy: enemy, platformTree) =
let let
(* todo: possibly get pID and eID of player/enemy in a different way *)
val pID = getPlatformBelowPlayer (player, platformTree, platforms) val pID = getPlatformBelowPlayer (player, platformTree, platforms)
val {x, y, ...} = enemy val {x, y, ...} = enemy
val eID = getPlatformBelowEnemy (enemy, platformTree, platforms) val eID = getPlatformBelowEnemy (enemy, platformTree, platforms)
val _ = print "start best path:\n"
val bestPath = PathFinding.start (pID, eID, platforms, platformTree) val bestPath = PathFinding.start (pID, eID, platforms, platformTree)
val _ = List.map (fn c => print (Int.toString c ^ "\n")) bestPath
val _ = print "finished best path\n\n"
val distance = Constants.moveEnemyBy * Constants.jumpLimit val distance = Constants.moveEnemyBy * Constants.jumpLimit

View File

@@ -166,7 +166,7 @@ struct
val plat3 = {id = 3, x = 355, y = 659, width = 555} val plat3 = {id = 3, x = 355, y = 659, width = 555}
val plat4 = {id = 4, x = 155, y = 855, width = 199} val plat4 = {id = 4, x = 155, y = 855, width = 199}
val plat5 = {id = 5, x = 155, y = 759, width = 199} val plat5 = {id = 5, x = 155, y = 759, width = 199}
val plat6 = {id = 6, x = 155, y = 610, width = 199} val plat6 = {id = 6, x = 155, y = 710, width = 199}
val platforms = Vector.fromList [plat1, plat2, plat3, plat4, plat5, plat6] val platforms = Vector.fromList [plat1, plat2, plat3, plat4, plat5, plat6]
val platformTree = Platform.generateTree platforms val platformTree = Platform.generateTree platforms

View File

@@ -26,8 +26,7 @@ struct
in in
(isBetween (prevX, curX, prevFinishX) (isBetween (prevX, curX, prevFinishX)
orelse orelse
isBetween (prevX, curFinishX, prevFinishX) isBetween (prevX, curFinishX, prevFinishX) andalso prevY + 155 >= curY)
andalso prevY + 155 >= curY)
end end
fun canDropDownTo (prevPlat: platform, currentPlat: platform) = fun canDropDownTo (prevPlat: platform, currentPlat: platform) =
@@ -39,8 +38,7 @@ struct
val curFinishX = curX + curWidth val curFinishX = curX + curWidth
in in
(isBetween (prevX, curX, prevFinishX) (isBetween (prevX, curX, prevFinishX)
orelse orelse isBetween (prevX, curFinishX, prevFinishX) andalso prevY <= curY)
isBetween (prevX, curFinishX, prevFinishX) andalso prevY <= curY)
end end
fun isReachableFromLeft (prevPlat, currentPlat) = fun isReachableFromLeft (prevPlat, currentPlat) =
@@ -126,10 +124,7 @@ struct
let let
val q = val q =
DistHeap.insert DistHeap.insert
( { distance = dist ( {distance = dist, id = foldPlatID, comesFrom = fromPlatID}
, id = foldPlatID
, comesFrom = fromPlatID
}
, q , q
) )
in in
@@ -141,12 +136,7 @@ struct
let let
val q = val q =
DistHeap.insert DistHeap.insert
( { distance = dist ({distance = dist, id = foldPlatID, comesFrom = fromPlatID}, q)
, id = foldPlatID
, comesFrom = fromPlatID
}
, q
)
in in
(eVals, q) (eVals, q)
end end
@@ -262,7 +252,6 @@ struct
val pos = IntSet.findInsPos (curID, eKeys) val pos = IntSet.findInsPos (curID, eKeys)
val {from, distance, ...} = ValSet.sub (eVals, pos) val {from, distance, ...} = ValSet.sub (eVals, pos)
val _ = print ("266 distance = " ^ Int.toString distance ^ "\n")
in in
helpGetPathList (from, eID, eKeys, eVals, acc) helpGetPathList (from, eID, eKeys, eVals, acc)
end end
@@ -274,7 +263,8 @@ struct
let let
val {platforms, ...} = env val {platforms, ...} = env
in in
if pos = Vector.length platforms then (eVals, q) if pos = Vector.length platforms then
(eVals, q)
else else
let let
val foldPlat = Vector.sub (platforms, pos) val foldPlat = Vector.sub (platforms, pos)