Why does my maze solver not work?

后端 未结 2 939
挽巷
挽巷 2021-01-26 13:43

I\'m trying to write a program that solves a specific inputted maze recursively and outputs it\'s position in the maze after each move.

Whenever I try and run my code,

相关标签:
2条回答
  • 2021-01-26 14:16

    There maybe a good reason behind this but I'm not sure why you ignore your const int of 16 as max Width and make it 17 instead. Might not solve the problem but that sure looks wrong to me.

    Also like a commenter said why initialise X and Y inside main's brackets? Why not just do it inside main. Or as the other poster said, turn that main function into a separate function then call it in a fresh main.

    0 讨论(0)
  • 2021-01-26 14:26

    When main is first called the runtime environment passes it arguments, so your default arguments aren't used. Rename the function and call it from main.

    0 讨论(0)
提交回复
热议问题