Apr-22-2019, 12:15 PM
Well, say you use
Before the loop over WINS, you set win_exists to False. During the loop, if at any point first, second, and third represent a win, set win_exists to True, and use a break statement to get out of the loop. That way, at the end of the loop, win_exists tells you if the current player won.
for first, second, third in WINS:
. The first time through the loop, first is 'top-L', second is 'top-M', and third is 'top-R'. You know how to test for a win with those three strings, right? So use that method to test first, second, and third for a win.Before the loop over WINS, you set win_exists to False. During the loop, if at any point first, second, and third represent a win, set win_exists to True, and use a break statement to get out of the loop. That way, at the end of the loop, win_exists tells you if the current player won.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures