exercism

Exercism - Install and Setup

This post shows you how to get started with Exercism.

Stevinator Stevinator
4 min read
exercism dart flutter install setup

Sign up

The first thing you need to do is go to exercism.org and click on the “Sign Up” button.

Signup Button

Enter your information and click the Sign-Up button. You can also signup with Github.

Signup Form

You will receive a confirmation e-mail. Click on the provided link and log in with your credentials.

A Term of Services window will greet you.

  • Check the “Accept Terms of Service” and “Accept Privacy Policy” boxes
  • In Communication Preferences, you can set how you will be notified when a mentor does something regarding your submitted exercise

Next, choose learn -> Language Track -> then the programming language you wish to do the exercises with. I hope you choose DART of course. 😉

Click on the “Join the DART Track”.

Joining the Dart track

Next you will be greeted with the following popup

Choosing Editor

You can go with the “In the online editor”, which means you don’t need to install anything on your machine. Or if you choose “On my local machine”, then please do the next steps, otherwise skip 😉

Install Exercism

Installing Exercism

  1. Click on “Install Exercism’s CLI”
  2. Choose your Operating System -> in this example MacOS
  3. Choose yes if it asks you if you are comfortable using the terminal -> choose yes
  4. If you have homebrew installed on your MacOs machine (if not check the next step first) then copy and paste the following line into your terminal brew update && brew install exercism
  5. Check if the exercism command is installed correctly using the following command exercism version
  6. Next, we need to enter our token so exercise knows where to upload our solution. Navigate to ProfilesettingsCLI Token and copy it. Paste it where it says “Your-API-TOKEN” in this command exercism configure —-token=YOUR_API_TOKEN
  7. Lastly copy this command exercism download --track=dart --exercise=hello-world to download your first exercise.

Install brew

  1. go-to brew.sh
  2. copy the code you see there in your terminal
  3. depending on your terminal type zsh or bash, change the command accordingly

Open Terminal and add the following commands

brew update
brew install exercism

Install dart SDK

You can find dart installation documentation in this website

With bew you can install it with these commands

brew tap dart-lang/dart && brew install dart

Hello World Exercise

Above screenshot shows you where your exercise is.

Next we need to navigate to to Exercism -> Hello World folder

~/Exercism/dart/hello-world

In the lib folder, you find the exercise file.

class HelloWorld {
  String hello() {
	return 'Hello, World!';
  }
}

Download dependencies and run the test

dart pub get
dart run test
+1 means that 1 test has been passed successfully 
-1 one test has been failed 
~3 three tests have been skipped → you need to unskip the tests in the test file → skip:false 

Submit your code – upload only the file that you changed. In mostly all cases, it is the file found inside the lib folder.

exercism submit hello_world.dart

Go to the website and reload the page. Now you can see that the solution has been uploaded.

Hello World Exercise Submit

You can click on Complete Exercise or book a slot with a mentor to talk about your solution and get expert opinion.

Submit your solution to the community and check how other students solved the exercise

Congratulations 🎉🎉🎉 Now go ahead and solve the next core or sidetrack exercise


You can watch this tutorial on YouTube. So don’t forget to like and subscribe. 😉

Watch on YouTube
Stevinator

Stevinator

Stevinator is a software engineer passionate about clean code and best practices. Loves sharing knowledge with the developer community.