Skip to content

Commit

Permalink
Add exercise to config
Browse files Browse the repository at this point in the history
Fixes in about text
  • Loading branch information
meatball133 committed Oct 11, 2024
1 parent 08ab682 commit b323112
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 17 deletions.
3 changes: 2 additions & 1 deletion concepts/numbers/.meta/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"authors": [
"pwadsworth"
"pwadsworth",
"meatball133"
],
"blurb": "Basics of Haskell numeric types"
}
5 changes: 3 additions & 2 deletions concepts/numbers/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fromIntegral 1
-- -> 1.0
```

To convert a `Float` to an `Int`, you can use the `round`, `floor`, or `ceiling` functions.
To convert a `Float` to an `Int`, you can use the [`round`][round], [`floor`][floor], or [`ceiling`][ceiling] functions.
The `round` function rounds to the nearest integer, `floor` rounds down, and `ceiling` rounds up.

```haskell
Expand Down Expand Up @@ -139,7 +139,7 @@ This is different from normal division.
```haskell
1 `mod` 0
# Exception: divide by zero
-- Exception: divide by zero
```
~~~~

Expand Down Expand Up @@ -181,3 +181,4 @@ It follows the order of parentheses(`()`), exponents(`**`), multiplication(`*`)
[pemdas]: https://en.wikipedia.org/wiki/Order_of_operations
[floor]: https://hackage.haskell.org/package/base/docs/Prelude.html#v:floor
[ceiling]: https://hackage.haskell.org/package/base/docs/Prelude.html#v:ceiling
[round]: https://hackage.haskell.org/package/base/docs/Prelude.html#v:round
10 changes: 5 additions & 5 deletions concepts/numbers/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fromIntegral 1
-- -> 1.0
```

To convert a `Float` to an `Int`, you can use the `round`, `floor`, or `ceiling` functions.
To convert a `Float` to an `Int`, you can use the [`round`][round], [`floor`][floor], or [`ceiling`][ceiling] functions.
The `round` function rounds to the nearest integer, `floor` rounds down, and `ceiling` rounds up.

```haskell
Expand Down Expand Up @@ -139,7 +139,7 @@ This is different from normal division.
```haskell
1 `mod` 0
# Exception: divide by zero
-- Exception: divide by zero
```
~~~~

Expand Down Expand Up @@ -179,6 +179,6 @@ It follows the order of parentheses(`()`), exponents(`**`), multiplication(`*`)
```

[pemdas]: https://en.wikipedia.org/wiki/Order_of_operations
[math]: https://crystal-lang.org/reference/latest/tutorials/basics/30_math.html
[int]: https://crystal-lang.org/reference/latest/syntax_and_semantics/literals/integers.html
[float]: https://crystal-lang.org/reference/latest/syntax_and_semantics/literals/floats.html
[floor]: https://hackage.haskell.org/package/base/docs/Prelude.html#v:floor
[ceiling]: https://hackage.haskell.org/package/base/docs/Prelude.html#v:ceiling
[round]: https://hackage.haskell.org/package/base/docs/Prelude.html#v:round
18 changes: 15 additions & 3 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
]
},
{
"slug": "temperature",
"name": "Temperature",
"uuid": "6ed15adb-f022-4bbd-bbb3-22845deabc91",
"slug": "freelancer-rates",
"name": "Freelancer Rates",
"uuid": "85e17e39-9506-4dc8-bed6-ecc44c840cc1",
"prerequisites": [
"basics"
],
Expand Down Expand Up @@ -96,6 +96,18 @@
"concepts": [
"algebraic-data-types"
]
},
{
"slug": "temperature",
"name": "Temperature",
"uuid": "6ed15adb-f022-4bbd-bbb3-22845deabc91",
"prerequisites": [
"basics"
],
"status": "deprecated",
"concepts": [
"numbers"
]
}
],
"practice": [
Expand Down
2 changes: 1 addition & 1 deletion exercises/concept/freelancer-rates/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Implement a function to calculate the monthly rate, and apply a discount:

```haskell
monthlyRate 77 10.5
# => 12130
-- -> 12130
```

The returned monthly rate should be rounded up (take the ceiling) to the nearest integer.
Expand Down
10 changes: 5 additions & 5 deletions exercises/concept/freelancer-rates/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fromIntegral 1
-- -> 1.0
```

To convert a `Float` to an `Int`, you can use the `round`, `floor`, or `ceiling` functions.
To convert a `Float` to an `Int`, you can use the [`round`][round], [`floor`][floor], or [`ceiling`][ceiling] functions.
The `round` function rounds to the nearest integer, `floor` rounds down, and `ceiling` rounds up.

```haskell
Expand Down Expand Up @@ -139,7 +139,7 @@ This is different from normal division.
```haskell
1 `mod` 0
# Exception: divide by zero
-- Exception: divide by zero
```
~~~~

Expand Down Expand Up @@ -179,6 +179,6 @@ It follows the order of parentheses(`()`), exponents(`**`), multiplication(`*`)
```

[pemdas]: https://en.wikipedia.org/wiki/Order_of_operations
[math]: https://crystal-lang.org/reference/latest/tutorials/basics/30_math.html
[int]: https://crystal-lang.org/reference/latest/syntax_and_semantics/literals/integers.html
[float]: https://crystal-lang.org/reference/latest/syntax_and_semantics/literals/floats.html
[floor]: https://hackage.haskell.org/package/base/docs/Prelude.html#v:floor
[ceiling]: https://hackage.haskell.org/package/base/docs/Prelude.html#v:ceiling
[round]: https://hackage.haskell.org/package/base/docs/Prelude.html#v:round

0 comments on commit b323112

Please sign in to comment.