Skip to content

Pathfinder#26

Open
Raild3x wants to merge 1 commit intomainfrom
feat/Pathfinder
Open

Pathfinder#26
Raild3x wants to merge 1 commit intomainfrom
feat/Pathfinder

Conversation

@Raild3x
Copy link
Owner

@Raild3x Raild3x commented Aug 7, 2025

No description provided.

@Raild3x Raild3x self-assigned this Aug 7, 2025
Copilot AI review requested due to automatic review settings August 7, 2025 15:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new pathfinder library that implements the A* pathfinding algorithm in Luau. The library provides a generic pathfinding solution with support for partial path finding when a complete path cannot be found.

Key Changes:

  • Implements A* pathfinding algorithm with configurable heuristics and traversal costs
  • Provides partial pathfinding capability as a fallback option
  • Includes comprehensive test coverage for heap data structure functionality

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
lib/pathfinder/wally.toml Package configuration file defining the pathfinder library metadata
lib/pathfinder/src/pathfinder.spec.luau Test suite for heap data structure with extensive coverage of heap operations
lib/pathfinder/src/init.luau Main pathfinder implementation with A* algorithm and partial path support

@@ -0,0 +1,103 @@
-- Author: Logan Hunt (Raild3x)
-- Marc 6, 2025
Copy link

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The date contains a spelling error. 'Marc' should be 'March'.

Suggested change
-- Marc 6, 2025
-- March 6, 2025

Copilot uses AI. Check for mistakes.
for i = 1, 99900 do
minHeap:Pop()
end
print(minHeap)
Copy link

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug print statement should be removed from test code as it adds unnecessary output during test execution.

Suggested change
print(minHeap)

Copilot uses AI. Check for mistakes.
expect(cIdx)
table.remove(values, vIdx)
table.remove(costs, cIdx)
print(value, cost)
Copy link

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug print statement should be removed from test code as it adds unnecessary output during test execution.

Suggested change
print(value, cost)

Copilot uses AI. Check for mistakes.
return path
end

while not openSet:IsEmpty() do
Copy link

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code calls openSet:IsEmpty() but the heap implementation being tested doesn't show an IsEmpty method. This will likely cause a runtime error.

Suggested change
while not openSet:IsEmpty() do
while not HeapIsEmpty(openSet) do

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant