Skip to content

Commit

Permalink
왕실의 나이트 (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ezidayzi committed Jan 5, 2022
1 parent 90b59f2 commit 1f0b6b9
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
n = input()
x, y = ord(n[0])-ord('a') + 1, int(n[1])
print(x, y)
count = 0

locations = [[2, 1], [2, -1], [-2, 1], [-2, -1], [1, 2], [1, -2], [-1, 2], [-1, -2]]

for location in locations:
print(x + location[0], y + location[1])
if 1 <= x + location[0] <= 8 and 1 <= y + location[1] <= 8:
count += 1

print(count)

0 comments on commit 1f0b6b9

Please sign in to comment.