This is my completed chapter 4 practice project, Character Picture Grid, from the book "Automate the Boring Stuff with Python" By: Al Sweigart
Below are the objectives:
- You have a list of lists where each value in the inner lists is a one-character string, like this:
grid = [['.', '.', '.', '.', '.', '.'], ['.', 'O', 'O', '.', '.', '.'], ['O', 'O', 'O', 'O', '.', '.'], ['O', 'O', 'O', 'O', 'O', '.'], ['.', 'O', 'O', 'O', 'O', 'O'], ['O', 'O', 'O', 'O', 'O', '.'], ['O', 'O', 'O', 'O', '.', '.'], ['.', 'O', 'O', '.', '.', '.'], ['.', '.', '.', '.', '.', '.']]
- Think of grid[x][y] as being the charactor at the x- and y-coordinates.
- (0, 0) will be upper-left corner, the x-coordinates increase going right and y- increase doing down
- Use the previous grid value and write code that uses is to print the image:
. . O O . O O . .
. O O O O O O O .
. O O O O O O O .
. . O O O O O . .
. . . O O O . . .
. . . . O . . . .
More details are commented in characterPictureGrid.py
This project is done, so feel free to comment or collaberate.