The reason why is that at some point, your code might span several thousand lines. Looking for that one magic number that is causing unexpected behaviour is going to be very time consuming.
By the way, I noticed that you declare and initialize this constant integer two times;
constexpr int WORLD_LENGTH = 5
Once in main()
and once inside the PrintIntro()
function. You would benefit from declaring this once, and earlier in the program - try moving it to the top of yoiur main()
function and removing it elsewhere, you’ll find that it works. The thing is to declare and initialize before you need it, and then rest assured that you have what you need when you do (saves you from repeating yourself). I hope this makes sense