Created
February 27, 2018 12:14
-
-
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 …
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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