Shahrayar123 / Python-Projects

Basic Python projects, good first issue
272 stars 276 forks source link

Error of Tic-Tac-Toe Game #149

Closed Rozaki0318 closed 7 months ago

Rozaki0318 commented 7 months ago

I have played Tic-Tac-Toe Game and found a following error. Could you assign this to me ?

$ python3 TicTacToe.py 
Do you want to play a game (Y/N): Y
-----------------------------------------
Welcome to the tic tac toe game

   |   |   
   |   |  
   |   |   
-----------
   |   |   
   |   |  
   |   |   
-----------
   |   |   
   |   |  
   |   |   

...

Enter a position between 1 to 9: 4
   |   |   
 X | O | X
   |   |   
-----------
   |   |   
 X | X | O
   |   |   
-----------
   |   |   
 O | X | O
   |   |   
Traceback (most recent call last):
  File "TicTacToe.py", line 136, in <module>
    main()
  File "TicTacToe.py", line 119, in main
    insertLetter("O", move)
  File "TicTacToe.py", line 4, in insertLetter
    board[pos] = letter
TypeError: list indices must be integers or slices, not NoneType
Rozaki0318 commented 7 months ago

I have already submit pull request for this issue, so this issue is not needed any more.