Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Compile and Execute VB.Net Online

Module VBModule
 
    Sub Main()
        dim startx as integer = 1
        dim starty as integer = 1
        Console.WriteLine(Findpath(startx,starty))
    End Sub
    Function FindPath(byval x as integer, byval y as integer)
        if (x > 11 or y>11) Then
            return false
        End if
        if (x,y = "G") Then
            return true
        if (x,y = "x" or x,y = "#") Then
            return false
        Else
            'mark x,y as part of solution path
        End If
        if (FINDPATH(x,y+1) =true) Then
            return true
        Elseif (FINDPATH(x+1,y) = true) Then
            return true
        Elseif (FINDPATH(x,y-1) =true) Then
            return true
        Elseif (FINDPATH(x-1,y) =true) Then
            return true
        Else
            'unmark x,y as part of solution path
            return false
        End If
    End Function
End Module

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.