File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ def get_args():
5353 if list (bord )[cell - 1 ] != '.' :
5454 parser .error (f'--cell "{ cell } " already taken' )
5555 else :
56- if player and not cell :
56+ if any ([ player , cell ]) and not all ([ player , cell ]) :
5757 parser .error ("Must provide both --player and --cell" )
5858
5959
@@ -180,11 +180,7 @@ def main():
180180 print (format_board (board ))
181181
182182 winner = find_winner (board )
183- print (f'{ winner } has won!' ) if winner else print ("No winner." )
184- # print(f'board = "{board}"')
185- # print(f'cell = "{cell}"')
186- # print(f'player = "{player}"')
187-
183+ print (f'{ winner } has won!' if winner else "No winner." )
188184
189185def test_move ():
190186 board = 'X.O'
@@ -193,7 +189,7 @@ def test_move():
193189
194190def processMove (bord , cel , speler ):
195191 updatedBord = list (bord )
196- updatedBord [cel - 1 ]= speler
192+ updatedBord [cel - 1 ]= speler
197193 return '' .join (updatedBord )
198194# --------------------------------------------------
199195if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments