Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def tr(x):
- b = 0
- if x == 'a':
- b = 0
- if x == 'b':
- b = 1
- if x == 'c':
- b = 2
- if x == 'd':
- b = 3
- if x == 'e':
- b = 4
- if x == 'f':
- b = 5
- if x == 'g':
- b = 6
- if x == 'h':
- b = 7
- return b
- def printpretty(x):
- for row in x:
- print(' '.join(row))
- a = input()
- h = 8 - int(a[1])
- w = tr(a[0])
- print(h, w)
- S = [['Q' if i == h and j == w else '*' if i == h or j == w or i + j == h + w or w - j == h - i else '.' for j in range(8)] for i in range(8)]
- printpretty(S)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement