Skip to content

Instantly share code, notes, and snippets.

@umair-tp
Created February 27, 2018 12:14
Show Gist options
  • Select an option

  • Save umair-tp/b1458d7d1eb0c34d1a15f275916596af to your computer and use it in GitHub Desktop.

Select an option

Save umair-tp/b1458d7d1eb0c34d1a15f275916596af to your computer and use it in GitHub Desktop.
Exercise 24 : This exercise is Part 1 of 4 of the Tic Tac Toe exercise series. The other exercises are: Part 2, Part 3, and Part 4. Time for some fake graphics! Let’s say we want to draw game boards that look like this: --- --- --- | | | | --- --- --- | | | | --- --- --- | | | | --- --- --- This one is 3x3 (like in tic tac toe). Obviously, they …
def printBoard(dimension):
for i in range(dimension):
for j in range(dimension):
print " ",
for k in range(dimension):
print "-",
print "\n",
print "|",
for j in range(dimension):
for k in range(dimension):
print " ",
print "|",
print ""
for j in range(dimension):
print " ",
for k in range(dimension):
print "-",
if __name__ == '__main__':
printBoard(int(raw_input("Enter board dimension : ")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment