구현 : 왕실의 나이트 [ 이것이 코딩테스트다 ] [ Python ]
코드 location = input() row = str(location[0]) column = int(location[1]) alpha = ["a", "b", "c", "d", "e", "f", "g", "h"] find_alpha = int(alpha.index(row)) + 1 # row 를 숫자로 변환 night = [find_alpha, column] # 나이트의 위치를 저장 array = [ [-1, -2], # "upleft" [1, -2], # "upright" [-2, -1], # "leftup" [-1, 1], # "leftdown" [-1, 2], # "downleft" [1, 2], # "downright" [2, -1], # "rightup" [2, 1] # "rightdown" ..
2023.05.18