Connect 4 Program Python 2
Posted on
Four-In-A-Row (a Connect Four clone) # # By Al Sweigart al@inventwithpython.com import random import copy import sys BOARDWIDTH = 7 BOARDHEIGHT = 6 def main(): '' b = getNewBoard() b[6][5] = 'X' b[5][4] = 'X' b[4][3] = 'X' b[3][2] = 'X' drawBoard(b) print(isWinner(b, 'X')) sys.exit(). Akon hits mp3 songs free download.
Python 2.4 Windows
Active11 months ago
i need to ask the user how many rows and how many columns the user would like so my game can handle whatever sized boards but i don't know how to change my code. Here's my connect 4 code that's for a 6x7 board.
poke233k51 gold badges362 silver badges428 bronze badges
user3161743user3161743663 gold badges6 silver badges13 bronze badges
1 Answer
You can now substitute these constants in your board-extent ranges to adjust the board size.
Hugh BothwellHugh Bothwell45.7k6 gold badges61 silver badges87 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.