update README, add plus11.gmh.source

This commit is contained in:
2020-05-10 10:54:00 +08:00
parent 68784da463
commit b527f30870
2 changed files with 48 additions and 6 deletions

View File

@@ -1,8 +1,15 @@
# grassmudhorse.rs
Grass Mud Horse in Rust
compile:
# Intrduction
Grass Mud Horse Language Spec - [https://playsecurity.org/rawfile/grass_mud_horse_language_specification.md](https://playsecurity.org/rawfile/grass_mud_horse_language_specification.md)
![](https://grassmudhorse.org/resources/gmh-lang.jpg)
# Compile
compile grassmudhorse.rs:
```shell
$ cargo b
@@ -11,15 +18,17 @@ OR
$ cargo b --release
```
# Usage
help:
```shell
$ ./target/debug/grassmudhorse -h
$ grassmudhorse -h
grassmudhorse.rs v0.1
```
execute from file:
```shell
$ ./target/debug/grassmudhorse print-110.gmh
$ grassmudhorse print-110.gmh
1
2
3
@@ -34,7 +43,7 @@ $ ./target/debug/grassmudhorse print-110.gmh
execute from stdin:
```shell
$ cat print-110.gmh | ./target/debug/grassmudhorse
$ cat print-110.gmh | grassmudhorse
1
2
3
@@ -47,8 +56,34 @@ $ cat print-110.gmh | ./target/debug/grassmudhorse
10
```
compile:
```shell
$ cat plus11.gmh.source
push 1
push 2
add
stdoutnum
push 10
stdoutchar
end
$ grassmudhorse --compile plus11.gmh.source
草草草泥马
草草草泥草马
泥草草草
泥马草泥
草草草泥草泥草马
泥马草草
马马马
$ grassmudhorse --compile plus11.gmh.source | grassmudhorse
3
```
compile and execute:
```shell
$ ./target/debug/grassmudhorse --compile plus1100.gmh.source | ./target/debug/grassmudhorse
$ grassmudhorse --compile plus1100.gmh.source | grassmudhorse
5050
```

7
plus11.gmh.source Normal file
View File

@@ -0,0 +1,7 @@
push 1
push 2
add
stdoutnum
push 10
stdoutchar
end