Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions problems.md
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
Copy link
Copy Markdown
Member

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>) -> usize my feeling is that lifetimes should not be necesary.

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor Author

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.

forth | Parser reimplementation
circular-buffer | Buffer reimplementation, Generics