My thoughts on any other const functions: No... Yes... Maybe

I have debated this with myself and I’m unsure.
My first thought was to say no, the only functions so far in our code to be const should be the getters.

But then I thought IsGameWon() doesn’t need to change anything. It just compares two strings//checks if number of Bulls equals length of secret word. So yes, this could also be a const.
Same goes with CheckGuessValidity(). It doesn’t need to change any variables. It just checks that the string the user wrote adheres to being just one word and that being an isogram.

I would say that the answer to which functions should be const will depend on how we implement them later.

Privacy & Terms