# 修改默认程序

在[探索默认项目](https://github.com/chengshuzhi/DfinityTutorials/tree/67efaf95e3f292cfe2fc958ffec63d10ccf7a6f9/si-.-jiao-cheng/1.-tan-suo-mo-ren-xiang-mu)章节，已经介绍了创建新项目会创建一个默认的src目录，并包含一个main.mo程序模板文件。

源码修改步骤

1.编辑器中打开src/location\_hello/main.mo 源码文件。

2.修改默认源码，用有city参数的location函数替换greet函数。

例如

```
actor {
 public func location(city : Text) : async Text {
 return "Hello, " # city # "!";
 };
};
```

3\. 保存并关闭文件。


---

# 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://mixdao.gitbook.io/dfinity/si-.-jiao-cheng/3.-chuan-di-wen-ben-can-shu/xiu-gai-mo-ren-cheng-xu.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.
