Skip to content

Add a take/2 task #1

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions