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.
Exercise 2.4.1 was very long compared to the other exercises. I made a new exercise for 2.4.1, and moved the old exercise to 2.4.2 (and indicated it as a bonus exercise). I also restored 2.4.1.C (now 2.4.2.C), which was previously removed, likely in an attempt to make the exercise shorter, but without which some of the later exercises did not make sense.
The new 2.4.1 exercise makes you implement vector addition and dot products for a
Vec2D
type, which later have to be made generic to support multiple number types.Things I considered including in the new 2.4.1 exercise but decided against:
vec * n
would work nicely, butn * vec
is hard to implement generically because of E0210Vec2D<T>
types withFrom
/Into
(e.g.Vec2D<i32>
toVec2D<i64>
): does not play nice with generics because of conflicting implementations from coreAny feedback or suggestions are welcome!