5-9 前だけを見て①
解説動画
※回答のブロックIDは236→237、35→41が正しいです。
解答コード
player.onChat("5-9", function () {
while (true) {
agent.move(FORWARD, 1);
if (agent.inspect(AgentInspection.Block, DOWN) == 57) {
break;
} else if (agent.inspect(AgentInspection.Block, DOWN) == 152 || agent.inspect(AgentInspection.Block, DOWN) == 22 || agent.inspect(AgentInspection.Block, DOWN) == 41) {
agent.turn(TurnDirection.Left);
} else if ((agent.inspect(AgentInspection.Block, DOWN) == 133 && agent.inspect(AgentInspection.Block, FORWARD) == 152) || (agent.inspect(AgentInspection.Block, DOWN) == 133 && agent.inspect(AgentInspection.Block, LEFT) == 22)) {
agent.turn(TurnDirection.Right);
}
}
});