def ask(self): for event in pygame.event.get(): if event.type==pygame.QUIT: pygame.quit() return 0 if event.type==pygame.MOUSEBUTTONDOWN: x,y=event.pos if x>25 and x<(25+(self.W-50)/3): if y>25 and y<(25+(self.H-50)/3): return 7 if y>(25+(self.H-50)/3) and y<(25+2*(self.H-50)/3): return 4 if y>(25+2*(self.H-50)/3) and y<(self.H-25): return 1 elif x>(25+(self.W-50)/3) and x<(25+2*(self.W-50)/3): if y>25 and y<(25+(self.H-50)/3): return 8 if y>(25+(self.H-50)/3) and y<(25+2*(self.H-50)/3): return 5 if y>(25+2*(self.H-50)/3) and y<(self.H-25): return 2 elif x>(25+2*(self.W-50)/3) and x<(self.W-25): if y>25 and y<(25+(self.H-50)/3): return 9 if y>(25+(self.H-50)/3) and y<(25+2*(self.H-50)/3): return 6 if y>(25+2*(self.H-50)/3) and y<(self.H-25): return 3