Pongeponge

# Codingame『Bender, a depressed robot』訳

ぶっちゃけ英語ではルールがよくわからんので適当に頑張って和訳してみる。

The 9 rules of the new Bender system:

1.マップの@からスタートしてSOUTHに行く。
1.Bender starts from the place indicated by the @ symbol on the map and heads SOUTH.

2.$マーク(自殺の名所)に到着するとベンダーは死ぬ。 2.Bender finishes his journey and dies when he reaches the suicide booth marked$.

3.障害物は#Xで表示される。
3.Obstacles that Bender may encounter are represented by # or X.

4.ベンダーが障害物に遭遇すると、SOUTH -> EAST -> NORTH -> WESTの優先順位に従って移動方向を変える。最初にSOUTH、次にEAST、次にNORTH、最後にWESTに行けるか試す。
4.When Bender encounters an obstacle, he changes direction using the following priorities: SOUTH, EAST, NORTH and WEST. So he first tries to go SOUTH, if he cannot, then he will go EAST, if he still cannot, then he will go NORTH, and finally if he still cannot, then he will go WEST.

5.経路変更マークに当たったら即方向変換する。SならSOUTHEならEASTNならNORTHWならWEST
5.Along the way, Bender may come across path modifiers that will instantaneously make him change direction. The S modifier will make him turn SOUTH from then on, E, to the EAST, N to the NORTH and W to the WEST.

6.逆変換回路(地図上ではI)を踏むと移動の優先順位が逆転してWEST -> NORTH -> EAST -> SOUTHになる。再び踏むと優先順位は元に戻る。
6.The circuit inverters (I on map) produce a magnetic field which will reverse the direction priorities that Bender should choose when encountering an obstacle. Priorities will become WEST, NORTH, EAST, SOUTH. If Bender returns to an inverter I, then priorities are reset to their original state (SOUTH, EAST, NORTH, WEST).

7.ビール(地図上ではB)を見つけるとブレーカーモードが発動する。発動中は障害物(X)を壊して進む。壊した残骸が残る(?)障害物を壊しても移動方向は維持される。
7.Bender can also find a few beers along his path (B on the map) that will give him strength and put him in “Breaker” mode. Breaker mode allows Bender to destroy and automatically pass through the obstacles represented by the character X (only the obstacles X). When an obstacle is destroyed, it remains so permanently and Bender maintains his course of direction. If Bender is in Breaker mode and passes over a beer again, then he immediately goes out of Breaker mode. The beers remain in place after Bender has passed.

8.テレポーターTはプレゼント。テレポーターを踏むと自動的に別のテレポーターに移動する。テレポーターで移動しても移動方向とブレーカーモードは変わらない。
8.2 teleporters T may be present in the city. If Bender passes over a teleporter, then he is automatically teleported to the position of the other teleporter and he retains his direction and Breaker mode properties.

9.最後に、スペース(空白)は何もないエリア。
9.Finally, the space characters are blank areas on the map (no special behavior other than those specified above).

プログラムでベンダーの移動を表示させよう。
Your program must display the sequence of moves taken by Bender according to the map provided as input.

マップは行と列に分かれている。マップは壊せない障害物#で囲まれている。マップの中には@と$が必ず入っている。 The map is divided into lines (L) and columns (C). The contours of the map are always unbreakable # obstacles. The map always has a starting point @ and a suicide booth$.

もしベンダーが自殺の名所にたどり着けずループしてるようならば、LOOPと表示する。
If Bender cannot reach the suicide booth because he is indefinitely looping, then your program must only display LOOP.

もう無理、力尽きた。

ベンダーマネジメント超入門: IT調達に関わる方のために