From 7adfaa80aa209eea9cc69d7ea612e867e76420b3 Mon Sep 17 00:00:00 2001 From: Chris Proctor Date: Thu, 28 Apr 2022 17:10:59 -0400 Subject: [PATCH] Correctly show player names --- ttt_view.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ttt_view.py b/ttt_view.py index 5f8dc4c..ccd7b83 100644 --- a/ttt_view.py +++ b/ttt_view.py @@ -11,9 +11,11 @@ class TTTView: def greet(self, game): "Starts a new game by greeting the players." + x_name = game.players['X'].name + o_name = game.players['O'].name print(self.greeting) - print(f"{game.players['X']} will play as X.") - print(f"{game.players['O']} will play as O.") + print(f"{x_name} will play as X.") + print(f"{o_name} will play as O.") def get_move(self, game): "Shows the board and asks the current player for their choice of move."