[docs]defset_secret_code(self)->None:# Generate random codeself.SECRET_CODE=tuple(randint(1,self.game_state.number_of_colors)for_inrange(self.game_state.number_of_dots))
[docs]defget_feedback(self,guess:tuple)->tuple:ifnothasattr(self,"SECRET_CODE"):raiseNotImplementedError("Secret code not set yet.")returngenerate_feedback(guess,self.SECRET_CODE,self.game_state.number_of_colors)
[docs]classAICodeCracker(CodeCracker):_WIN_MESSAGE="Congratulations! You won in {step} steps!"_LOSE_MESSAGE="Sorry, you lost. The secret code was {step}."
[docs]defobtain_guess(self)->tuple:# TODO: Implement AI solver logic to generate guess.pass