You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mg-chao 854cff1149
update: translate tests
3 years ago
..
exercises update: translate tests 3 years ago
src update the orgnization of the repo, add rustling -> exercise 3 years ago
tests update the orgnization of the repo, add rustling -> exercise 3 years ago
.all-contributorsrc update the orgnization of the repo, add rustling -> exercise 3 years ago
.clog.toml update the orgnization of the repo, add rustling -> exercise 3 years ago
.editorconfig update the orgnization of the repo, add rustling -> exercise 3 years ago
.gitignore Update gitignore, ignore .DS_Store file. 3 years ago
.gitpod.yml update the orgnization of the repo, add rustling -> exercise 3 years ago
.replit update the orgnization of the repo, add rustling -> exercise 3 years ago
CHANGELOG.md update the orgnization of the repo, add rustling -> exercise 3 years ago
CONTRIBUTING.md update the orgnization of the repo, add rustling -> exercise 3 years ago
Cargo.lock update the orgnization of the repo, add rustling -> exercise 3 years ago
Cargo.toml update the orgnization of the repo, add rustling -> exercise 3 years ago
LICENSE update the orgnization of the repo, add rustling -> exercise 3 years ago
README.md update readmes 3 years ago
default_out.txt update the orgnization of the repo, add rustling -> exercise 3 years ago
info.toml update: translate tests 3 years ago
install.ps1 update the orgnization of the repo, add rustling -> exercise 3 years ago
install.sh update the orgnization of the repo, add rustling -> exercise 3 years ago

README.md

Rust Exercise 🦀❤️

Rust练习题是Rust学习教程的第二步请在完成第一步后,再来做题。

本项目从rustlingfork而来主要有以下改变

  1. 翻译成中文
  2. 为<<精通Rust编程>>一书提供相应的配套练习题
  3. 未来提供一些更有针对性和更有难度的习题,官方的还是太简单了

开始使用

注意: 如果你在使用MacOS确保已经安装了Xcode以及相应的开发者工具 xcode-select --install.

同时你也需要安装Rust具体参见<<精通Rust编程>>一书或者访问https://rustup.rs

手动安装

Clone该项目然后运行cargo install.

git clone https://github.com/rustcm/rustex
cd exercise
cargo install --force --path .

如果有安装错误请先升级rust工具链

rustup update

然后, 运行rustex来启动.

使用方式

练习题是按照专题(topic)来排序的,具体可以在/exercises/<topic>下找到。

完成练习的方式其实挺简单的,大多数可以通过修改代码、通过编译的方式来完成。还有些练习需要让你编写代码来通过测试,总之目标是比较简单的:让它运行起来。

我们强烈建议你按照推荐的顺序来做练习题,在终端执行:

rustex watch

该命令会在预先定义的顺序下,来呈现练习题,同时,在你修改了exercises/下的任何一处代码并保存后,都会触发一次重新编译运行,因此无需再手动去编译运行。当然你也可以通过以下命令来只运行一次:

rustex verify

和watch做的事情基本一致但是在运行后会自动退出。

如果想要指定运行一个练习题,可以运行:

rustex run myExercise1

或者也可以运行下一个未完成的练习

rustex run next

一旦你遇到解决不了的问题,可以运行下面的命令来获得帮助提示:

rustex hint myExercise1

你也可以直接对下一道未解决的问题获取帮助提示:

rustex hint next

想要查看目前的学习进度:

rustex list

Testing yourself

在每完成几个专题后会有一个quiz测验这个测验是对这些内容的综合测试可以在exercises/quizN.rs下找到

Uninstalling rustex

从系统中移除rustex需要两个步骤。首先移除已经安装的练习题文件夹

rm -rf rustex # 或者你的自定义文件夹

其次因为rustex是通过cargo install安装的,所以你可以通过cargo uninstall rustex来移除rustex这个可执行二进制文件:

cargo uninstall rustex

最后...没有最后了,恭喜你,已经卸载完成。

写在最后

rustex目前也只是开始远远没有达到完成的地步欢迎大家来贡献自己的力量一起为这个项目添砖加瓦未中国Rust的快速发展贡献自己的力量。

Contributing

参见CONTRIBUTING.md.

Contributors

  1. 致敬英文版的练习项目rustling
  2. Sunface