1

Hey Devrant fam!, well i'm basically trying to see if i can change up this A* algo we need to implement for an assessment, and from what i know basically most people have copy and pasted it, but not me!, so there is this one called Easy A* (star) Pathfinding By Nicholas Swift and my goal is such that i would like to make it input friendly!, here is the code in my main function

def main():
start1,start2 = input('Enter co-ordinates').split(',')
end1,end2 = input('Enter co-ordinates').split(',')

drive_mount()
open_map()

# test1 = (start1, start2)
# test2 = (end1, end2)

start = (start1, start2)
end = (end1, end2)

print(f'start co-ordinates:{start} \n end co-ordinates:{end}')

our_path = astar(our_maze, start, end)
print(f'starting co-ordinates:{start} \n ending co-ordinates:{end} \n Your shortest-path:{our_path}')

if __name__ == '__main__':
main()

however i am then greeted by this error, on line 62 specifically it says "TypeError: must be str, not int" and my original thought was to put str() around all of them, but that does not seem to work :-) any advice? thank you!

Comments
  • 1
    Would be easier if you could gist your whole code or something. We don't even have line 62 here :)
  • 0
    @ScriptCoded its quite large :-), if it allows me to here is the link i am using :to help me! https://medium.com/@nicholas.w.swif...

    also thank you!
  • 0
    @ScriptCoded just a quick thing, im doing all this in google colabs, my first cell contains the imported items and does the following opens my map from my text file located in my google drive, and the other item is just to mount to my drive, 2nd cell is the actual code Node() class and main function :-)
Add Comment