VERSION 5.00
Begin VB.Form Pathing_Form 
   Caption         =   "Pathing Form"
   ClientHeight    =   3120
   ClientLeft      =   60
   ClientTop       =   420
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3120
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
End
Attribute VB_Name = "Pathing_Form"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Type A_Sector
    exits(1 To 6) As Integer
    sector_number
End Type

Dim path(1 To 30) As Integer
Dim all_sectors(1 To 500) As A_Sector

Function adjacent_sector()
'Determines whether one sector is adjacent to another.  Code not included.

End Function

Public Sub compute_shortest_path(Source As Integer, destination As Integer, step As Integer, max_depth As Integer, start As Boolean)
Dim z As Integer

While found_it = False


        If adjacent_sector(Source, destination) = True Then
                path(step + 1) = destination
                found_it = True
        Else
            If step < max_depth Then
            For i = 1 To Num_Exits
                If Source <> 0 Then
                    If all_sectors(Source).exits(i) <> 0 Then
                            compute_shortest_path all_sectors(Source).exits(i), destination, step + 1, max_depth - 1, False
                    End If
                End If
            Next i
            End If
        End If
        If start = True Then
            max_depth = max_depth + 1
           If max_depth > Max_Distance_Possible Then
                x = MsgBox("There is currently no path to that destination sector!", vbOKOnly, "No path!")
                Exit Sub
           End If
        Else
             If found_it = True Then
                    path(step) = Source
            End If
            Exit Sub
        End If
Wend
If found_it = True And start = True Then
    path(step) = Source
End If

End Sub
