Skip to content

Add a take/2 task #1

@gausby

Description

@gausby

If we do this workshop again we should consider adding a take/2 task to the assignments.

All groups ended up having two accumulators in their solution, because all the previous assignments up until chunk/2 could be solved using accumulators. Only one group had an alternative solution that used a take/2 helper function.

Learning how to juggle two accumulators are good, but I guess learning how to opt for a helper for some of the heavy lifting is a good lesson too. Just look at this diff: gausby@bd454b9

Question is though; should the take/2 assignment come before the chunk/2 assignment, or should it come earlier as it is rather "easy"1 to implement? The former would make it obvious that it can help solving chunk, the latter would hide it a bit, letting the student think a bit before reaching for take/2.


1 "easy" to implement compared to the other functions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions