Skip to content

Commit 448af71

Browse files
authored
Table alignment in functional/index.md (#152)
* Right align table in plain text version Makes the plain text version easier to read * Center alignment in mdbook/md
1 parent 7ac0b4f commit 448af71

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

functional/index.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ println!("{}", sum);
1515
With imperative programs, we have to play compiler to see what is happening. Here, we start with a `sum` of `0`. Next, we iterate through the range from 1 to 10. Each time through the loop, we add the corresponding value in the range. Then we print it out.
1616

1717
| `i` | `sum` |
18-
| --- | ----- |
19-
| 1 | 1 |
20-
| 2 | 3 |
21-
| 3 | 6 |
22-
| 4 | 10 |
23-
| 5 | 15 |
24-
| 6 | 21 |
25-
| 7 | 28 |
26-
| 8 | 36 |
27-
| 9 | 45 |
28-
| 10 | 55 |
18+
|:---:|:-----:|
19+
| 1 | 1 |
20+
| 2 | 3 |
21+
| 3 | 6 |
22+
| 4 | 10 |
23+
| 5 | 15 |
24+
| 6 | 21 |
25+
| 7 | 28 |
26+
| 8 | 36 |
27+
| 9 | 45 |
28+
| 10 | 55 |
2929

3030
This is how most of us start out programming. We learn that a program is a set of steps.
3131

@@ -40,14 +40,14 @@ Whoa! This is really different! What's going on here? Remember that with declara
4040
Here, we are composing functions of addition (this closure: `|a, b| a + b)`) with a range from 1 to 10. The `0` is the starting point, so `a` is `0` at first. `b` is the first element of the range, `1`. `0 + 1 = 1` is the result. So now we `fold` again, with `a = 1`, `b = 2` and so `1 + 2 = 3` is the next result. This process continues until we get to the last element in the range, `10`.
4141

4242
| `a` | `b` | result |
43-
| --- | --- | ------ |
44-
| 0 | 1 | 1 |
45-
| 1 | 2 | 3 |
46-
| 3 | 3 | 6 |
47-
| 6 | 4 | 10 |
48-
| 10 | 5 | 15 |
49-
| 15 | 6 | 21 |
50-
| 21 | 7 | 28 |
51-
| 28 | 8 | 36 |
52-
| 36 | 9 | 45 |
53-
| 45 | 10 | 55 |
43+
|:---:|:---:|:------:|
44+
| 0 | 1 | 1 |
45+
| 1 | 2 | 3 |
46+
| 3 | 3 | 6 |
47+
| 6 | 4 | 10 |
48+
| 10 | 5 | 15 |
49+
| 15 | 6 | 21 |
50+
| 21 | 7 | 28 |
51+
| 28 | 8 | 36 |
52+
| 36 | 9 | 45 |
53+
| 45 | 10 | 55 |

0 commit comments

Comments
 (0)