提交 9414f3e2 编写于 作者: chai2010's avatar chai2010

update readme

上级 2855ac80
......@@ -49,6 +49,33 @@
更多细节请参考 [凹语言™项目目标](docs/goals.md)
## 例子: 你好, 凹语言
打印字符和调用函数:
```
fn main() {
print('凹')
print('语')
print('言')
print('\n')
println(add(40, 2))
}
fn add(a: i32, b: i32) => i32 {
return a+b
}
```
运行并输出结果:
```
$ go run main.go hello.wa
凹语言
42
```
## 例子: 打印素数
打印 30 以内的素数:
......
# 版权 @2019 凹语言 作者。保留所有权利。
fn main() {
println(40+2)
print('凹')
print('语')
print('言')
print('\n')
println(add(40, 2))
}
fn add(a: i32, b: i32) => i32 {
return a+b
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册