Skip to content

Commit 78b1d83

Browse files
committed
Format Notebooks
1 parent 77d9694 commit 78b1d83

File tree

185 files changed

+684
-559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+684
-559
lines changed

exercises/anagram.livemd

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,4 @@ $ git commit -m "finish anagram exercise"
122122

123123
| Previous | Next |
124124
| ---------------------------------------------- | ---------------------------------------------------------------------: |
125-
| [Voter Count](../exercises/voter_count.livemd) | [Custom Enum With Reduce](../exercises/custom_enum_with_reduce.livemd) |
125+
| [Voter Count](../exercises/voter_count.livemd) | [Custom Enum With Reduce](../exercises/custom_enum_with_reduce.livemd) |

exercises/anagram_solver.livemd

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ $ git commit -m "finish anagram solver exercise"
7070

7171
## Up Next
7272

73-
| Previous | Next |
74-
| :------- | ----:|
75-
| [Factorial](../exercises/factorial.livemd) | [Big O Notation](../reading/big_o_notation.livemd) |
73+
| Previous | Next |
74+
| ------------------------------------------ | -------------------------------------------------: |
75+
| [Factorial](../exercises/factorial.livemd) | [Big O Notation](../reading/big_o_notation.livemd) |

exercises/arithmetic.livemd

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,4 +269,4 @@ Run the following in your command line from the project folder to track and save
269269
```
270270
$ git add .
271271
$ git commit -m "finish arithmetic exercise"
272-
```
272+
```

exercises/battle_map.livemd

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,6 @@ $ git commit -m "finish battle map exercise"
140140

141141
## Up Next
142142

143-
| Previous | Next |
144-
| :------- | ----:|
145-
| [Math](../exercises/math.livemd) | [Computer Hardware](../reading/computer_hardware.livemd) |
143+
| Previous | Next |
144+
| -------------------------------- | -------------------------------------------------------: |
145+
| [Math](../exercises/math.livemd) | [Computer Hardware](../reading/computer_hardware.livemd) |

exercises/benchmarks.livemd

+26-19
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Mix.install([
1919
Ensure you type the `ea` keyboard shortcut to evaluate all Elixir cells before starting. Alternatively you can evaluate the Elixir cells as you read.
2020

2121
## Overview
22+
2223
In this set of exercises, you're going to use [Benchee](https://github.com/bencheeorg/benchee) to benchmark
2324
common operations.
2425

@@ -57,54 +58,60 @@ inputs: %{
5758
## Lists Vs Tuples
5859

5960
### Access
61+
6062
In the Elixir cell below, benchmark the following:
61-
- Determine the length of a list
62-
- Determine the length of a tuple
63-
- Retrieve the first element in a list
64-
- Retrieve the last element in a list
65-
- Retrieve the first element in a tuple
66-
- Retrieve the last element in a tuple
63+
64+
* Determine the length of a list
65+
* Determine the length of a tuple
66+
* Retrieve the first element in a list
67+
* Retrieve the last element in a list
68+
* Retrieve the first element in a tuple
69+
* Retrieve the last element in a tuple
6770

6871
Ensure that you test these operations with `1000` elements, `10_000` elements, and `100_000` elements.
6972

7073
## Keyword Lists Vs Maps
7174

7275
In the Elixir cell below,
73-
- Create a `small_map` variable with `1000` elements
74-
- Create a `medium_map` variable with `10_000` elements
75-
- Create a `large_map` variable with `100_000` elements
76-
- Create a `small_keyword_list` variable with `1000` elements
77-
- Create a `medium_keyword_list` variable with `10_000` elements
78-
- Create a `large_keyword_list` variable with `100_000` elements
76+
77+
* Create a `small_map` variable with `1000` elements
78+
* Create a `medium_map` variable with `10_000` elements
79+
* Create a `large_map` variable with `100_000` elements
80+
* Create a `small_keyword_list` variable with `1000` elements
81+
* Create a `medium_keyword_list` variable with `10_000` elements
82+
* Create a `large_keyword_list` variable with `100_000` elements
7983

8084
```elixir
8185

8286
```
8387

8488
In the Elixir cell below, benchmark the following:
85-
- Update an element in the map.
86-
- Update the first element in the keyword list.
87-
- Update the last element in the keyword list
89+
90+
* Update an element in the map.
91+
* Update the first element in the keyword list.
92+
* Update the last element in the keyword list
8893

8994
```elixir
9095

9196
```
9297

9398
In the Elixir cell below, benchmark the following:
94-
- Insert a new element into a map.
95-
- Insert a new element the start of a keyword list.
96-
- Insert a new element the end of a keyword list.
99+
100+
* Insert a new element into a map.
101+
* Insert a new element the start of a keyword list.
102+
* Insert a new element the end of a keyword list.
97103

98104
```elixir
99105

100106
```
101107

102108
Ensure that you test these operations with `1000` elements, `10_000` elements, and `100_000` elements.
109+
103110
## Commit Your Progress
104111

105112
Run the following in your command line from the project folder to track and save your progress in a Git commit.
106113

107114
```
108115
$ git add .
109116
$ git commit -m "finish benchmarks exercise"
110-
```
117+
```

exercises/binary_search.livemd

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,4 @@ Run the following in your command line from the project folder to track and save
156156
```
157157
$ git add .
158158
$ git commit -m "finish binary search exercise"
159-
```
159+
```

exercises/bingo_winner.livemd

+3-3
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,6 @@ $ git commit -m "finish bingo winner exercise"
146146

147147
## Up Next
148148

149-
| Previous | Next |
150-
| :------- | ----:|
151-
| [Filter Values By Type](../exercises/filter_values_by_type.livemd) | [Number Wordle](../exercises/number_wordle.livemd) |
149+
| Previous | Next |
150+
| ------------------------------------------------------------------ | -------------------------------------------------: |
151+
| [Filter Values By Type](../exercises/filter_values_by_type.livemd) | [Number Wordle](../exercises/number_wordle.livemd) |

exercises/bomb_defusal.livemd

+2-1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Send a `Bomb` an `:explode` message. It should handle the message by terminating
7373
The `BombSupervisor` should automatically restart all of the `Bomb` processes.
7474

7575
## (Bonus) :cut
76+
7677
We will defuse bombs by sending them a `:cut` message with a `:red`, `:white`, or `:black` wire.
7778

7879
When a `Bomb` is initialized, it should store a randomized wire of either `:red`, `:white`, or `:black` in
@@ -100,4 +101,4 @@ Run the following in your command line from the project folder to track and save
100101
```
101102
$ git add .
102103
$ git commit -m "finish bomb defusal exercise"
103-
```
104+
```

exercises/boolean_operators.livemd

+3-3
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,6 @@ $ git commit -m "finish boolean operators exercise"
283283

284284
## Up Next
285285

286-
| Previous | Next |
287-
| :------- | ----:|
288-
| [Mad Libs](../exercises/mad_libs.livemd) | [Guessing Games](../exercises/guessing_games.livemd) |
286+
| Previous | Next |
287+
| ---------------------------------------- | ---------------------------------------------------: |
288+
| [Mad Libs](../exercises/mad_libs.livemd) | [Guessing Games](../exercises/guessing_games.livemd) |

exercises/bottles_of_soda.livemd

+3-3
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,6 @@ $ git commit -m "finish bottles of soda exercise"
208208

209209
## Up Next
210210

211-
| Previous | Next |
212-
| :------- | ----:|
213-
| [Measurements](../exercises/measurements.livemd) | [Item Generator](../exercises/item_generator.livemd) |
211+
| Previous | Next |
212+
| ------------------------------------------------ | ---------------------------------------------------: |
213+
| [Measurements](../exercises/measurements.livemd) | [Item Generator](../exercises/item_generator.livemd) |

exercises/caesar_cypher.livemd

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,6 @@ $ git commit -m "finish caesar cypher exercise"
9090

9191
## Up Next
9292

93-
| Previous | Next |
94-
| :------- | ----:|
95-
| [Classified](../exercises/classified.livemd) | [Rollable Expressions](../exercises/rollable_expressions.livemd) |
93+
| Previous | Next |
94+
| -------------------------------------------- | ---------------------------------------------------------------: |
95+
| [Classified](../exercises/classified.livemd) | [Rollable Expressions](../exercises/rollable_expressions.livemd) |

exercises/candy_store.livemd

+19-17
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ Create the following test cases for `CandyStore.Item`.
6060
Create a `CandyStore.ItemTest` module in `tests/item_test.ex`.
6161

6262
Create the following test cases for the following:
63-
- given a `:name`, `:cost`, and `:type` field it should create an Item struct.
64-
- The Item struct should enforce the `:name` and `:type` fields.
63+
64+
* given a `:name`, `:cost`, and `:type` field it should create an Item struct.
65+
* The Item struct should enforce the `:name` and `:type` fields.
6566

6667
## Create the CandyStore.search/2 Function
6768

@@ -78,22 +79,23 @@ CandyStore.search(items, query)
7879
Create a `CandyStore.search/2` function and the following test cases:
7980
(You may use any test names, so long as your tests cover the following functionality)
8081

81-
- given a list of items, when searching the full name of one item, then it should only find matching items.
82-
- given a list of items, when searching the partial name of one item, then it should only find matching items.
83-
- given a list of items, when searching the a non matching name, it should find no items.
84-
- given a list of items, when searching by type, it should find matching items.
85-
- given a list of items, when searching by a non-matching type, it should find no items.
86-
- given a list of items, when searching by exact cost, it should find matching items.
87-
- given a list of items, when searching by all filters (:type, :cost, and :name) it should find matching items.
82+
* given a list of items, when searching the full name of one item, then it should only find matching items.
83+
* given a list of items, when searching the partial name of one item, then it should only find matching items.
84+
* given a list of items, when searching the a non matching name, it should find no items.
85+
* given a list of items, when searching by type, it should find matching items.
86+
* given a list of items, when searching by a non-matching type, it should find no items.
87+
* given a list of items, when searching by exact cost, it should find matching items.
88+
* given a list of items, when searching by all filters (:type, :cost, and :name) it should find matching items.
8889

8990
Ensure all tests pass.
9091

9192
## (Bonus) Search By Price
9293

9394
Add the following functionality and cases to allow users to search by price:
94-
- given a list of items, when searching by `:max_cost`, it should find items below the max cost.
95-
- given a list of items, when searching by `:min_cost`, it should find items below the max cost.
96-
- given a list of items, when searching by `:cost` with a range, it should find items within the range.
95+
96+
* given a list of items, when searching by `:max_cost`, it should find items below the max cost.
97+
* given a list of items, when searching by `:min_cost`, it should find items below the max cost.
98+
* given a list of items, when searching by `:cost` with a range, it should find items within the range.
9799

98100
## (Bonus) Item Validation
99101

@@ -104,10 +106,10 @@ Use `Ecto Changesets` validate the `Item` struct in an `Item.new/1` function.
104106

105107
Then create the following test cases:
106108

107-
- `Item.new/1` should return a changeset error if `:name` is not a string.
108-
- `Item.new/1` should return a changeset error if `:type` is not an atom.
109-
- `Item.new/1` should return a changeset error if `:cost` is not a integer.
110-
- `Item.new/1` should return a struct if `:name`, `:type`, and `:cost` are all valid.
109+
* `Item.new/1` should return a changeset error if `:name` is not a string.
110+
* `Item.new/1` should return a changeset error if `:type` is not an atom.
111+
* `Item.new/1` should return a changeset error if `:cost` is not a integer.
112+
* `Item.new/1` should return a struct if `:name`, `:type`, and `:cost` are all valid.
111113

112114
## Commit Your Progress
113115

@@ -116,4 +118,4 @@ Run the following in your command line from the project folder to track and save
116118
```
117119
$ git add .
118120
$ git commit -m "finish candy store exercise"
119-
```
121+
```

exercises/capstone_project_mock.livemd

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ $ git commit -m "finish capstone project mock exercise"
5555

5656
## Up Next
5757

58-
| Previous | Next |
59-
| :------- | ----:|
60-
| [Portfolio Mock](../exercises/portfolio_mock.livemd) | [Portfolio Blog Live Search](../exercises/portfolio_blog_live_search.livemd) |
58+
| Previous | Next |
59+
| ---------------------------------------------------- | ---------------------------------------------------------------------------: |
60+
| [Portfolio Mock](../exercises/portfolio_mock.livemd) | [Portfolio Blog Live Search](../exercises/portfolio_blog_live_search.livemd) |

exercises/card_counting.livemd

+3-3
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,6 @@ $ git commit -m "finish card counting exercise"
197197

198198
## Up Next
199199

200-
| Previous | Next |
201-
| :------- | ----:|
202-
| [Fun Formulas](../exercises/fun_formulas.livemd) | [Habit Tracker](../exercises/habit_tracker.livemd) |
200+
| Previous | Next |
201+
| ------------------------------------------------ | -------------------------------------------------: |
202+
| [Fun Formulas](../exercises/fun_formulas.livemd) | [Habit Tracker](../exercises/habit_tracker.livemd) |

exercises/character_generator.livemd

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,4 @@ Run the following in your command line from the project folder to track and save
118118
```
119119
$ git add .
120120
$ git commit -m "finish character generator exercise"
121-
```
121+
```

exercises/classified.livemd

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ $ git commit -m "finish classified exercise"
7373

7474
## Up Next
7575

76-
| Previous | Next |
77-
| :------- | ----:|
78-
| [Phone Number Parsing](../exercises/phone_number_parsing.livemd) | [Caesar Cypher](../exercises/caesar_cypher.livemd) |
76+
| Previous | Next |
77+
| ---------------------------------------------------------------- | -------------------------------------------------: |
78+
| [Phone Number Parsing](../exercises/phone_number_parsing.livemd) | [Caesar Cypher](../exercises/caesar_cypher.livemd) |

exercises/command_line_family_tree.livemd

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ The names for this exercise were generated with https://www.behindthename.com/ra
5656

5757
| Previous | Next |
5858
| ---------------------------------------------- | ---------------------------------------------------------: |
59-
| [Code Editors](../reading/code_editors.livemd) | [Livebook Recovery](../exercises/livebook_recovery.livemd) |
59+
| [Code Editors](../reading/code_editors.livemd) | [Livebook Recovery](../exercises/livebook_recovery.livemd) |

exercises/concurrent_image_processing.livemd

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,6 @@ $ git commit -m "finish concurrent image processing exercise"
8383

8484
## Up Next
8585

86-
| Previous | Next |
87-
| :------- | ----:|
88-
| [Smart Cache](../exercises/smart_cache.livemd) | [Kitchen Queue](../exercises/kitchen_queue.livemd) |
86+
| Previous | Next |
87+
| ---------------------------------------------- | -------------------------------------------------: |
88+
| [Smart Cache](../exercises/smart_cache.livemd) | [Kitchen Queue](../exercises/kitchen_queue.livemd) |

exercises/creature_spawner.livemd

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,6 @@ $ git commit -m "finish creature spawner exercise"
8686

8787
## Up Next
8888

89-
| Previous | Next |
90-
| :------- | ----:|
91-
| [Dominoes](../exercises/dominoes.livemd) | [Typing Game](../exercises/typing_game.livemd) |
89+
| Previous | Next |
90+
| ---------------------------------------- | ---------------------------------------------: |
91+
| [Dominoes](../exercises/dominoes.livemd) | [Typing Game](../exercises/typing_game.livemd) |

exercises/currency_conversion.livemd

+10-8
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,16 @@ instead money will be stored in a `Money` struct.
3939

4040
> "If I had a dime for every time I've seen someone use FLOAT to store currency, I'd have $999.997634" -- Bill Karwin
4141
42-
- Create a `Money` struct with `:amount` and `:currency`.
43-
- Create a `convert/2` function to convert a money struct from one currency to another.
44-
- Create an `add/2` function to add one money struct of the same currency to another.
45-
- Create a `subtract/2` function to subtract one money struct of the same currency to another.
46-
- Create a `multiply` function to multiply one money struct by a number.
42+
* Create a `Money` struct with `:amount` and `:currency`.
43+
* Create a `convert/2` function to convert a money struct from one currency to another.
44+
* Create an `add/2` function to add one money struct of the same currency to another.
45+
* Create a `subtract/2` function to subtract one money struct of the same currency to another.
46+
* Create a `multiply` function to multiply one money struct by a number.
4747

4848
### Examples
4949

5050
<!-- livebook:{"force_markdown":true} -->
51+
5152
```elixir
5253
five_eur = Money.new(500, :EUR)
5354
%Money{amount: 500, currency: :EUR}
@@ -94,6 +95,7 @@ Utils.feedback(:money, Money)
9495
```
9596

9697
This exercise is inspired by the Elixir [Money](https://github.com/elixirmoney/money) library.
98+
9799
## Commit Your Progress
98100

99101
Run the following in your command line from the project folder to track and save your progress in a Git commit.
@@ -105,6 +107,6 @@ $ git commit -m "finish currency conversion exercise"
105107

106108
## Up Next
107109

108-
| Previous | Next |
109-
| :------- | ----:|
110-
| [Metric Conversion](../exercises/metric_conversion.livemd) | [Bitstrings](../reading/bitstrings.livemd) |
110+
| Previous | Next |
111+
| ---------------------------------------------------------- | -----------------------------------------: |
112+
| [Metric Conversion](../exercises/metric_conversion.livemd) | [Bitstrings](../reading/bitstrings.livemd) |

exercises/custom_enum_with_recursion.livemd

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ $ git commit -m "finish custom enum with recursion exercise"
8181

8282
## Up Next
8383

84-
| Previous | Next |
85-
| :------- | ----:|
86-
| [Recursion](../reading/recursion.livemd) | [Lucas Numbers](../exercises/lucas_numbers.livemd) |
84+
| Previous | Next |
85+
| ---------------------------------------- | -------------------------------------------------: |
86+
| [Recursion](../reading/recursion.livemd) | [Lucas Numbers](../exercises/lucas_numbers.livemd) |

exercises/custom_enum_with_reduce.livemd

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,6 @@ $ git commit -m "finish custom enum with reduce exercise"
110110

111111
## Up Next
112112

113-
| Previous | Next |
114-
| :------- | ----:|
115-
| [Anagram](../exercises/anagram.livemd) | [Measurements](../exercises/measurements.livemd) |
113+
| Previous | Next |
114+
| -------------------------------------- | -----------------------------------------------: |
115+
| [Anagram](../exercises/anagram.livemd) | [Measurements](../exercises/measurements.livemd) |

0 commit comments

Comments
 (0)