Example #1
0
    def _draw_current_eqn(self):
        if self.board.current_input:
            guess_num = int_from_digits(self.board.current_input)
            eqn_render = self.board.current_eqn.render(guess=guess_num)
        else:
            eqn_render = self.board.current_eqn.render()

        text = self.font.render(eqn_render, 1, self.teal)
        self.surface.blit(text, (self.board.eqn_xpos, self.board.eqn_ypos))
        text_rect = pygame.Rect(self.board.eqn_xpos - 25, self.board.eqn_ypos - 30, 200, 78)
        pygame.draw.rect(self.surface, self.red, text_rect, 1)
Example #2
0
 def has_correct_guess(self):
     '''Return if the current_input matches the answer.'''
     guess = int_from_digits(self.current_input)
     return self.current_eqn.answer == guess