How to solve a basic maze using functions in python?

☆樱花仙子☆ 提交于 2019-12-02 10:01:13

The error you are encountering occurs because main calls solve without a required argument.

def main():

    print_maze()
    start()
    solve() # Error! Missing required arg
    print_maze()

Since solve redefines start_point right away you can just remove that required argument:

def solve():

    start_point = start()

Finally, you didn't provide maze so anybody trying to help you beyond this problem won't be able to

You need to pass the value returned from start() into the solve() function because you listed it as an argument. You can then remove the start_point= portion from the solve() function.

def main():
    print_maze()
    start = start()
    solve(start)
    print_maze()

Try to change the def slove format eg; == "X" = "x²"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!