Created
December 29, 2016 23:15
-
-
Save anddam/5eb33994fc900f5a92cbd7db6665bc12 to your computer and use it in GitHub Desktop.
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
| 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', '.', '.', '.'], | |
| ['.', '.', '.', '.', '.', '.'],] | |
| rotated = [] | |
| for row in grid: | |
| for index, item in enumerate(row): | |
| try: | |
| rotated[index].append(item) | |
| except: | |
| rotated.append([item]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment