My picks for const getter functions

I believe GetCurrentTry(); should be the const getter function of the 3 due to 2 reasons:

-The method GetCurrentTry(); is only returning the variable MyCurrentTry, and it is not modifying it in any sort of matter.

-The method IsGameWon(); and CheckGuessValidity(); only returns either true or false depending on conditions(since it is a boolean), and it doesn’t hold any variable that isn’t permitted to change, for now.

Privacy & Terms