-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathConnect4Part1.py
More file actions
28 lines (23 loc) · 924 Bytes
/
Connect4Part1.py
File metadata and controls
28 lines (23 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import random
print("Welcome to Connect Four")
print("-----------------------")
possibleLetters = ["A","B","C","D","E","F","G"]
gameBoard = [["","","","","","",""], ["","","","","","",""],["","","","","","",""],["","","","","","",""],["","","","","","",""],["","","","","","",""]]
rows = 6
cols = 7
def printGameBoard():
print("\n A B C D E F G ", end="")
for x in range(rows):
print("\n +----+----+----+----+----+----+----+")
print(x, " |", end="")
for y in range(cols):
if(gameBoard[x][y] == "🔵"):
print("",gameBoard[x][y], end=" |")
elif(gameBoard[x][y] == "🔴"):
print("", gameBoard[x][y], end=" |")
else:
print(" ", gameBoard[x][y], end=" |")
print("\n +----+----+----+----+----+----+----+")
def modifyTurn(spacePicked, turn):
gameBoard[spacePicked[0]][spacePicked[1]] = turn
printGameBoard()