Once you've implemented the
hello-world exercise, the next task is to implement 20+ other exercises.
There are two types of exercises you can implement:
In general, we recommend new tracks start with implementing Practice Exercises, as they're easier to implement and require less thinking upfront. Concept Exercises can always be added later, once your track is up and running properly.
To help tracks implement Practice Exercises, we've created the exercism/problem-specifications repository. This repository contains metadata for over 100+ Practice Exercises, which different tracks can then use to implement their track-specific version of these exercises from. For this reason, you'll see the same exercises implemented across many different tracks.
So how do you select the 20+ from this list of 100+ exercises? Here are some guidelines.
There is a lot of variety in concepts used in the 100+ exercises. You should aim to implement exercises that have students practice a wide variety of concepts. So instead of implementing 20 exercises that focus on strings, try to implement exercises that focus on different concepts.
Here are some concepts with sample exercises:
|Bit manipulation||allergies, secret-handshake|
|Dates and time||gigasecond, meetup|
|Floating-point numbers||darts, space-age|
Some exercises will be more difficult to implement than others. You should aim to implement exercises with varying degrees of difficulty: some easy ones, some intermediate ones and some hard ones.
How difficult an exercise is depends on several factors, such as the involved concepts and the track's language. It might help to check what the exercise looks like in other tracks that have implemented the exercise, to better get a feel for what the implementation could look like.
Here are some difficulties with exercises:
|Easy||darts, gigasecond, isogram, leap, resistor-color, space-age|
|Intermediate||allergies, bob, meetup, protein-translation, raindrops, secret-handshake|
|Hard||alphametics, forth, react, pov, zebra-puzzle, zipper|
Not all exercises may fit your track. You should only select those exercises that fit your track; better to not implement an exercise than to implement one that does not make sense. As an example, the lens-person exercise has the student working with lenses, which many languages don't support.
If you find an exercise that doesn't fit your track, you can add its slug to the
exercises.foregone array in the track config.json file.
This will ensure that tooling will ignore that exercise.
To make this all a bit more concrete, this is what a sample selection of initial exercises could look like:
|hello-world||Easy||None (initial exercise)|
|gigasecond||Easy||Dates and time|
|two-fer||Easy||String formatting, Optional arguments|
|meetup||Intermediate||Dates and time|
Having selected the exercises you want include in your track, the next step is to implement them. Each of the above-mentioned exercises has three bits of information:
description.md: explains what the exercise is about (required)
metadata.toml: metadata like the exercise's blurb (required)
canonical-data.json: a set of input/output combinations that describe the behavior of the exercise (optional)
There are two options when implementing one of the above exercises:
The second option can be particularly appealing, as it can give you results quickly. Keep in mind, though, that you should tweak the implementation to best fit your track. As an example, some tracks do not use classes but only work with functions. If your track usually works with objects though, you should adapt the implementation to what best fits your track.