EDIT: If you read the gist before, I've updated it with my latest version. I'm pretty sure I took care of everyone's comments, thanks so much!
So! The new tutorial will be focused on building several small projects in Rust. This example is the first one: a classic 'guessing game.' This was one of the first programs I wrote when I first learned C. 😄
I'd like the feedback of the community before I actually start writing the guide. So this code will be the final code of the first real example Rust programmers see. So I want it to be good. I don't claim this code is good, I just worked something out real quick. Oh, and this is tracking master.
The idea is that I will slowly build from hello world to this final code in steps, introducing one concept at a time. Here are the concepts I'd like a Rust programmer to understand by the time they're done:
- If
- Functions
- return (wrt semicolons)
- comments
- Testing
- attributes
- stability markers
- Crates and Modules
- visibility
- Compound Data Types
- Tuples
- Structs
- Enums
- Match
- Looping
- for
- while
- loop
- break/continue
- iterators
I don't know how this is going to be documented, but I would make extra sure to highlight the differences between
.unwrap()
and the match block.Otherwise it looks great! Clear, concise and fun. Great job Steve.