-
Notifications
You must be signed in to change notification settings - Fork 543
Add file that documents the thought behind problem order #167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # Rust Track Problem Order | ||
|
|
||
| The actual source of truth of problem order is [config.json](config.json), but this file documents our reasoning behind the problem order in that file. | ||
|
|
||
| ## Background | ||
|
|
||
| - https://github.com/exercism/xrust/issues/126 | ||
| - https://github.com/exercism/xrust/issues/127 | ||
| - http://designisrefactoring.com/2016/07/09/exercism-shouldnt-make-you-cry/ | ||
|
|
||
| # The Problems, By Section | ||
|
|
||
| ## Introduction | ||
|
|
||
| The first section contains the sort of stuff you expect when learning any programming languages: conditionals, booleans, looping and some higher-order functions. | ||
|
|
||
| problem | topics | ||
| ----- | ----- | ||
| hello-world | Some/None. println! | ||
| gigasecond | crates, math | ||
| leap | math, booleans, conditionals | ||
| raindrops | case (or `format`). Mutable string | ||
| bob | chars, string functions | ||
| beer-song | case, string concatenation, vector (optional), loop | ||
| difference-of-squares | fold & map | ||
|
|
||
| ## Getting Rusty | ||
|
|
||
| Problems begin to use more Rust-specific features. Try to only introduce one new language feature at a time. And if several problems rely on a feature, try to group them so as to reinforce its usage. | ||
|
|
||
| problem | topics | ||
| ----- | ----- | ||
| hamming | Result | ||
| scrabble-score | chaining higher-order functions, HashMap (optional) | ||
| pangram | filter, ascii (optional) | ||
| nucleotide-count | filter, entry api, mutablity, match | ||
| word-count | hashmap, str vs string, chars, entry api | ||
| etl | btree | ||
| sieve | vector, map, while let (optional) | ||
| rna-transcription | match, struct, str vs string | ||
| roman-numerals | mutable, results, loops, struct, traits | ||
| hexadecimal | Option, zip/fold/chars, map | ||
| grade-school | struct, entry api, Vec, Option | ||
| tournament | enum, sorting, hashmap, structs | ||
| robot-simulator | Immutability, enum | ||
| queen-attack | struct, trait (optional), Result | ||
| sublist | enum, generic over type | ||
| allergies | struct, enum, bitwise (probably), vectors, filter | ||
| variable-length-quantity | Encodings, slices, bitwise, Result | ||
| phone-number | option, format, unwrap_or, iters, match | ||
| wordy | Result, string parsing, operators (optional) | ||
| custom-set | generic over type, vector, equality, struct | ||
|
|
||
| ## Rust Gets Strange | ||
|
|
||
| Exercises that pay the cost of Rust's [strangeness budget](http://words.steveklabnik.com/the-language-strangeness-budget). Features that are very specific to Rust. | ||
|
|
||
| problem | topics | ||
| ----- | ----- | ||
| anagram | lifetimes, str vs string, loops, iter, vector | ||
| nucleotide-codons | struct, hash map, lifetimes, Result | ||
| robot-name | struct, slices, randomness, lifetimes, self mut | ||
|
|
||
| ## Putting it all Together | ||
|
|
||
| These problems don’t necessarily require additional Rust knowledge, but they do require complex solutions. | ||
|
|
||
| problem | topics | ||
| ----- | ----- | ||
| minesweeper | Board state | ||
| dominoes | Graph theory, searching | ||
| parallel-letter-frequency | multi-threading | ||
| rectangles | Enum, structs, traits, Lifetimes | ||
| forth | Parser reimplementation | ||
| circular-buffer | Buffer reimplementation, Generics | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
similarly to #166, I need to think about this a bit. My solution to this problem has no lifetime annotations. Since the function under test is
count(lines: &Vec<&str>) -> usizemy feeling is that lifetimes should not be necesary.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I haven't done Rectangles, I based this list on the example which does use lifetimes
For these Putting It All Together problems I'm less concerned about Rust features, though. The order of these problems doesn't really matter, as there's no real progression. And by this point the student should be familiar with Rust's feature set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if there's a quick summary of the type of problems you'll have to solve while working on Rectangles, that will do fine.