Python Forum
help needed for a friend! :)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help needed for a friend! :)
#14
Look at your current code for flip
def flip(board, row, col, player, playerOpposite):
   while(row<len(board)-2 or col!=0):
      row+=1
      col-=1
      print(row,col)
      if (board[row][col]==playerOpposite):
        board[row][col]=player
Your while loop will continue as long as col is not zero. Given that col starts negative and you continue to subtract one from it, it will always be non-zero and it is an infinite loop.
Reply


Messages In This Thread
help needed for a friend! :) - by Powell123 - Apr-30-2021, 04:07 PM
RE: help needed for a friend! :) - by Powell123 - Apr-30-2021, 05:31 PM
RE: help needed for a friend! :) - by BashBedlam - May-03-2021, 02:45 PM
RE: help needed for a friend! :) - by Powell123 - May-05-2021, 02:42 PM
RE: help needed for a friend! :) - by Powell123 - May-05-2021, 08:27 PM
RE: help needed for a friend! :) - by GOTO10 - May-06-2021, 12:24 PM
RE: help needed for a friend! :) - by jefsummers - May-06-2021, 03:47 PM
RE: help needed for a friend! :) - by Powell123 - May-06-2021, 08:13 PM
RE: help needed for a friend! :) - by jefsummers - May-06-2021, 10:43 PM
RE: help needed for a friend! :) - by Powell123 - May-08-2021, 02:02 PM
RE: help needed for a friend! :) - by Powell123 - May-08-2021, 07:17 PM
RE: help needed for a friend! :) - by jefsummers - May-09-2021, 11:36 AM
RE: help needed for a friend! :) - by Powell123 - May-10-2021, 09:07 AM
RE: help needed for a friend! :) - by jefsummers - May-10-2021, 11:44 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020