File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,30 @@ def offer_choices(self) -> list[Coordinate]:
7171 if square .value == " "
7272 ]
7373
74+ def play (self ):
75+ """
76+ TODO: https://www.youtube.com/watch?v=Q6CCdCBVypg
77+ repeat
78+ Initialise board
79+ while not game over
80+ player 1 turn
81+ check for game over
82+ if not game over
83+ player 2 turn
84+ check for game over
85+ end if
86+ end while
87+ calculate winner
88+ display winner
89+ another game ?
90+ until exit selected
91+ """
92+ while self .winner is None :
93+ choice = input (f"Player { self .current_player .symbol } enter your choice: " )
94+ print (self .board .render ())
95+ pass
96+ pass
97+
7498
7599@dataclass (frozen = True )
76100class TicTacToe :
@@ -86,7 +110,7 @@ def load_game(self, board: Board) -> Game:
86110
87111def main () -> None :
88112 game = TicTacToe ().new_game ()
89- print ( game .board . render () )
113+ game .play ( )
90114
91115
92116if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments