Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scout command #1209

Merged
merged 6 commits into from
Apr 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add comment
  • Loading branch information
kostmo committed Apr 18, 2023
commit 5409acbda5078ff87f4b28eb61969edba9619d59
2 changes: 2 additions & 0 deletions src/Swarm/Game/Step.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1972,6 +1972,8 @@ execConst c vs s k = do
(xMin, xMax) = sortPair (x1, x2)
(yMin, yMax) = sortPair (y1, y2)

-- NOTE: This function only makes sense to use with two locations that share
-- either the same x-coordinate or y-coordinate.
hasSightLineTo :: HasRobotStepState sig m => Location -> Location -> m Bool
kostmo marked this conversation as resolved.
Show resolved Hide resolved
hasSightLineTo (P (V2 x1 y1)) (P (V2 x2 y2)) =
fmap not $ anyM hasOpaque $ rectCellsInt32 x1 y1 x2 y2
Expand Down