This is the base repository for my take on the book 57 exercises for programmers. This is done to keep record of all the exercises I've done to increase my fluency in Elixir.
For some of these execises I used dependencies (it's cumbersome to do HTTP requests or JSON parsing without a library), so make sure to run
mix deps.get
mix run 01-saying-hello.exs
Simple "Hello World" with no special constraints.
mix run 02-counting-characters
Simple output with String operations.
mix run 03-printing-quotes
Simple test for String concatenation without interpolation and escaping quotes
mix run 04-mad-libs.exs
Concatenating multiple inputs.
mix run 05-simple-math.exs
Do simple math operations while sanitizing and converting user input.
mix run 06-retirement-calculation.exs
Simple math in combination with basic DateTime functionality.
mix run 07-recatngular-room.exs
Calculating an area while using conversion.
mix run 08-pizza-party.exs
Calculate the number of slices from a pizza (remainder division)
mix run 09-paint-calculator.exs
Given the area of a room, calculate the number of buckets needed to cover the rooms area with paint.
mix run 10-item-checkout.exs
Implement a calculation for arbitrary items during checkout (e.g. at a super market).
mix run 11-currency-exchange.exs
Implement a calculation for arbitrary items during checkout (e.g. at a super market), optionally using the OpenExchangeRates API.
mix run 12-computing-interest.exs
Computes the simple interest value over a number of years:
Challenges:
- Ensure that the values entered for principal, rate, and number of years are numeric
- Calculate the end value of the investment
- print the amount at the end of each year
mix run 13-computing-compound-interest.exs
Computes compound interest over a number of years.
mix run 14-tax-calculator.exs
A simple program that checks for the users state and displays a total amount in- or excluding tax.
mix run 15-validating-passwords.exs
Simple password validation to test if/else branches.
mix run 16-legal-driving-age.exs
Asks the user for their age and then decides if they're old enough to drive.
mix run 17-blood-alcohol-calculator.exs
Asks the user for their body measurements and drinks had and decides whether or not they are allowed to drive.
mix run 18-temperature-converter.exs
Simple temperature conversion between Fahrenheit and Celsius. Uses an input loop.
mix run 19-bmi-calculator.exs
Given measurements of a person, calculate their BMI (Body mass index).
mix run 20-multistate-tax-calculator.exs
Calculate tax rates for different states in the US, with some branching options for different counties.
mix run 21-numbers-to-names.exs
Converts numbers to month names.
mix run 22-comparing-numbers.exs
Compares three numbers and findest the highest one.
mix run 23-troubleshootings-cars.exs
A simple implementation of a decision making tree with multiple questions.
mix run 24-anagrams.exs
A small program to compare two inputs to see if they are anagrams of each other.
mix run 25-password-strength.exs
A program to check the strength of a given password.
mix run 27-validating-input.exs
Use validation functions to sanitize user inputs
mix run 28-adding-numbers.exs
A program to add several numbers together.
mix run 29-bad-input.exs
A program dealing with the handling of a bad input to a simple question.
mix run 30-multiplication-table
A program that displays a multiplication table for a given number.
mix run 31-heart-rate.exs
A program to display heart rate information in a table.
mix run 32-guess-the-number.exs
A game to guess a number - for doing infinite game loops.
mix run 33-magic-eight-ball.exs
A magic 8 ball!
mix run 34-employee-list-removal.exs
A simple list edit on a fixed list.
mix run 35-picking-a-winner.exs
A program to randomly pick an item from a list generated of inputs.
mix run 36-computing-statistics.exs
Ask the user for a set of numbers until they are 'done'. Then compute a set of numbers from the initial set.
mix run 37-password-generator.exs
A password generation tool
mix run 38-filtering-values.exs
Asks the user for a list of values, then filter out the numbers based on a criterium.
mix run 39-sorting-records.exs
Given a list of initial records, sort them by a given field. Does not contain the MySQL (i.e. database connected) version, as the sorting would then have to be done on the db side.
mix run 40-filtering-records.exs
Given a list of records, filter out records based on a given string and dsiplay them as a table
mix run 41-name-sorting.exs
Reads in a list of names from a file and sorts them alphabetically.
mix run 41-data-parsing.exs
Reads in a CSV file with a custom built algorithm, then displays it's contents as a table.
mix run 43-website-generator.exs
Simple generator to create a folder with files.
mix run 44-product-search.exs
A search over a static json file. Since Elixir has no native json support, Poison is used.
mix run 45-word-finder.exs
A search and repalce for the content of a given file.
mix run 46-word-frequency.exs
A program to count word occurences - the default version uses a text provided in ./files
. the exercises also states it should be tests with a longer text, e.g. this one - A compressed file for usage was added - Elixir supports the reading of compressed files on the fly.
mix run 47-who-is-in-space.exs
A program that calls the OpenNotify API and lists the results in the terminal.
OWM_KEY=<your_key> mix run 48-grabbing-the-weather.exs
Grabs the location of the user and then tries to get weather information based on that location from OpenWeatherMap.