这个python代码中有没有逻辑错误

xdyibdwo  于 2021-07-13  发布在  Java
关注(0)|答案(0)|浏览(133)

**结束。**此问题需要详细的调试信息。它目前不接受答案。
**想改进这个问题吗?**更新问题,使其成为堆栈溢出的主题。

9小时前关门了。
改进这个问题
您好,在这个tic-tac-toe python项目中,我总是收到一个平局游戏消息,我的知识中没有看到任何逻辑错误,请帮助我完成这个项目,这个代码中有任何逻辑错误,我定义的函数没有任何问题,一切正常,请帮我完成这个项目

print ('Welcome to tic tac toe')

   while True:
       the_board = [' ']*10
       player1_marker , player2_marker = player_input()
       turn = choose_first()
       print(turn+' will go first')

       start = input('Ready to play y or n')
       if start == 'y':
           game_on = True
       else:
           game_on = False

       while game_on:
           if turn == 'Player 1':
               display_board(the_board)
               position = player_choice(the_board) 
               place_marker(the_board,player1_marker,position)

               if win_check(the_board,player1_marker):
                   display_board(the_board)
                   print('Congradulation player 1 has won')
                   game_on= False
               else:
                   if full_board_check(the_board):
                       display_board(the_board)
                       print ('Tie game')
                       game_on = False
                   else:
                       turn = 'Player 2'
           else:
               display_board(the_board)
               position = player_choice(the_board) 
               place_marker(the_board,player2_marker,position)

               if win_check(the_board,player2_marker):
                   display_board(the_board)
                   print('Congradulation player 2 has won')
                   game_on= False
               else:
                   if full_board_check(the_board):
                           display_board(the_board)
                           print ('Tie game')
                           game_on= False
                   else:
                       turn = 'Player 1'

       if not replay():
               break

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题