Skip to content

Instantly share code, notes, and snippets.

@v2e4lisp
Last active December 11, 2015 10:29
Show Gist options
  • Save v2e4lisp/4587570 to your computer and use it in GitHub Desktop.
Save v2e4lisp/4587570 to your computer and use it in GitHub Desktop.
def convert2d (m):
l = len(m)
for y in range(0, l):
for x in range(0, l-y):
m[x][y], m[l-1-y][l-1-x] = m[l-1-y][l-1-x], m[x][y]
return m
def prettify (m):
for r in m:
print " " * 4 + str(r)
print " "* 4 + "-." * 15
test = [str(i) for i in range(0, 10)] + [chr(i) for i in range(65, 91)]
m = [test[i*6: i*6+6] for i in range (0, 6)]
prettify(m)
prettify(convert2d(m))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment