Python Forum
Game not letting player 1 win straight away
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Game not letting player 1 win straight away
#3
A couple things that might help you:

>>> a = [1, 1, 1]
>>> a[0] == a[1] == a[2] == 1
True
and:

lines = [(0, 1, 2), (3, 4, 5), (6, 7, 8), ...]
for a, b, c in lines:
    if grid[a] == grid[b] == grid[c] == 'X':
        print('Player one wins!')
        ...
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Game not letting player 1 win straight away - by ichabod801 - Aug-15-2017, 05:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  trying to put a a filter on identifying a straight CompleteNewb 1 1,684 Dec-01-2021, 11:11 PM
Last Post: CompleteNewb
  coding a 2-player die game Pepper887 3 2,488 Mar-17-2019, 04:02 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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