【マップの扱い 3】マップの判定・縦横斜め Python3編
code:py
H, W = map(int, input().split())
lines = []
for _ in range(H):
lines.append(line)
y, x = map(int, input().split())
# x列を反転
for i in range(H):
if not i == y:
else:
# y行を反転
for index in range(W):
else:
# 左斜め上を反転
poit = 1
for _ in range(H):
if y - poit >= 0 and x - poit >= 0:
else:
# 右斜め上を反転
if y - poit >= 0 and x + poit < W:
else:
# 左斜め下を反転
if y + poit < H and x - poit >= 0:
else:
# 右斜め下を反転
if y + poit < H and x + poit < W:
else:
# カウントして次のポインターへ
poit += 1
# 結果出力
for line in lines:
print(''.join(line))