#!/usr/bin/env Y if turn == R else

#!/usr/bin/env python2

# -*- coding: utf-8 -*-

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

“””

Created on Wed Nov 8 15:05:00 2017

“””

def D_Neg (table, columns, rows):

“””Showing negative diagonals, going from top-left to bottom-right.”””

for di in ((j, i – columns + j + 1) for j in range(columns) for i in range(columns + rows – 1)):

yield tableij for i, j in di if i >= 0 and j >= 0 and i = 0 and j >= 0 and i = C4.win:

return color

def showGame (C4):

“””Printing the game.”””

print(‘ ‘.join(map(str, range(C4.columns))))

for y_axis in range(C4.rows):

print(‘ ‘.join(str(C4.gamex_axisy_axis) for x_axis in range(C4.columns)))

print()

from itertools import groupby, chain

if __name__ == ‘__main__’:

g = Connect4()

turn = R

while True:

g.showGame()

row = input(‘{}’s turn: ‘.format(‘R’ if turn == R else ‘Y’))

g.insert(int(row), turn)

turn = Y if turn == R else R

Go Top
x

Hi!
I'm Eleanor!

Would you like to get a custom essay? How about receiving a customized one?

Check it out