def start(self): self.console.start() if self.players==[]: p_list = playerDialog().show() for x in p_list: new_player1 = player(x[0],self.default_money) new_player1.token_index = x[1] self.players.append(new_player1) self.gameWindow=GameWindow(self.board,self.players,self.console) init_state(self.players,self.board,self.console,self.gameWindow) self.gameWindow.run() self.current_player_index = randrange(len(self.players)) self.curr_player=self.players[self.current_player_index] self.console.display("{} takes the first turn".format(self.curr_player.name)) time.sleep(2) while not self.is_complete(): self.console.display(" ") self.next_turn() if not self.winner == -1: self.console.show_winner(self.winner)
def start(self): self.console.start() if self.players == []: p_list = playerDialog().show() for x in p_list: new_player1 = player(x[0], self.default_money) new_player1.token_index = x[1] self.players.append(new_player1) self.gameWindow = GameWindow(self.board, self.players, self.console) init_state(self.players, self.board, self.console, self.gameWindow) self.gameWindow.run() self.current_player_index = randrange(len(self.players)) self.curr_player = self.players[self.current_player_index] self.console.display("{} takes the first turn".format( self.curr_player.name)) time.sleep(2) while not self.is_complete(): self.console.display(" ") self.next_turn() if not self.winner == -1: self.console.show_winner(self.winner)
from gui import playerDialog name = "haha" name = playerDialog().show() print(name)