# 火星车实战

## 需求介绍

火星漫步者在某块区域中根据指令进行移动，然后采集相应位置的火星数据。

火星车收到的指令分为四类：

1. 探索区域信息：告知火星车，整片区域的长度（X）和宽度（Y）有多大；
2. 初始化信息：火星车的降落地点（x, y）和朝向（N, S, E, W）信息；
3. 移动指令：火星车可以前进（M）；
4. 转向指令：火星车可以左转 90 度（L）或右转 90 度（R）。

由于地球和火星之间的距离很远，指令必须批量发送，火星车执行完整批指令之后，再回报自己所在的位置坐标和朝向。

## 示例

```bash
Input (example):
5 5
1 2 N
LMLMLMLMM

Expected Output:
1 3 N
```

 通过 GUI 如图：

![MarsRover UI](/files/-M26PPRGRKHIUhexjpVE)

## 计算火星车位置

我们先不着急开始写代码，而是从任务分解的角度花点时间分析一下。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jimmylv.gitbook.io/tdd-frontend/coding/01-marsrover/06-what-is-marsrover.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
