https://github.com/nanmu42/guess-number
使用Rust实现的一个按大小反馈猜数字的游戏
https://github.com/nanmu42/guess-number
rust rust-lang tutorial
Last synced: about 1 year ago
JSON representation
使用Rust实现的一个按大小反馈猜数字的游戏
- Host: GitHub
- URL: https://github.com/nanmu42/guess-number
- Owner: nanmu42
- Created: 2019-11-23T15:18:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-23T15:21:13.000Z (over 6 years ago)
- Last Synced: 2025-02-10T11:34:45.453Z (over 1 year ago)
- Topics: rust, rust-lang, tutorial
- Language: Rust
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Guess Number
使用Rust实现的一个按大小反馈猜数字的游戏。
# 例子
```
我会在1到100想一个数,看你几轮可以猜中它! :)
这是你的第1次尝试。
请输入你的猜测:
50
你猜的数字是50
太小了! :P
这是你的第2次尝试。
请输入你的猜测:
70
你猜的数字是70
太小了! :P
这是你的第3次尝试。
请输入你的猜测:
90
你猜的数字是90
太大了! :P
这是你的第4次尝试。
请输入你的猜测:
80
你猜的数字是80
太小了! :P
这是你的第5次尝试。
请输入你的猜测:
85
你猜的数字是85
太小了! :P
这是你的第6次尝试。
请输入你的猜测:
89
你猜的数字是89
太大了! :P
这是你的第7次尝试。
请输入你的猜测:
88
你猜的数字是88
恭喜你猜对了!
```
# 参考资料
* [The Rust Programming Language](https://doc.rust-lang.org/book/ch02-00-guessing-game-tutorial.html)