Personality Test
Mix.install([
{:kino, github: "livebook-dev/kino", override: true},
{:kino_lab, "~> 0.1.0-dev", github: "jonatanklosko/kino_lab"},
{:vega_lite, "~> 0.1.4"},
{:kino_vega_lite, "~> 0.1.1"},
{:benchee, "~> 0.1"},
{:ecto, "~> 3.7"},
{:math, "~> 0.7.0"},
{:faker, "~> 0.17.0"},
{:utils, path: "#{__DIR__}/../utils"},
{:tested_cell, git: "https://github.com/BrooklinJazz/tested_cell"}
])
Navigation
Personality Test
In this exercise, you will create an Elixir script to run a personality test from the terminal.
Create a personality_test.exs
script in the projects folder, which you should be able to run with:
$ elixir personality_test.exs
This will be a two choice personality test. You have creative freedom over what you would like the personality test to decide.
For our example, we’ll use a “Are you a dog person or a cat person?” test.
The personality test will ask the user 5 questions. Each question has 2 choices which help determine if they are one personality type or another.
For example,
- Do you love to go for walks? yes/no
- Do you value your alone time and need a lot of it? yes/no
- Are you generally high energy? yes/no
- Do you prefer sports or reading a book? sports/book
- Water or soda? water/soda
You can use IO.gets/1
to ask the user questions from the script.
Once finished with the quiz, it should print out a result based on their answers.
"You are a Dog person!"
Commit Your Progress
Run the following in your command line from the project folder to track and save your progress in a Git commit.
$ git add .
$ git commit -m "finish personality quiz script exercise"