You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/lectures/data/manipulating_rectangular_arrays.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ The code for this lecture is available [in this archive](./code/projects/MagicSq
13
13
14
14
The following code sum the values contained in a 2-dimensional array row per row, and display the result each time before moving on to the next row:
15
15
16
-
```
16
+
```{download="./code/projects/MagicSquare.zip"}
17
17
!include`snippetStart="// Summing the values row per row", snippetEnd="As an exercise, you can"` code/projects/MagicSquare/MagicSquare/Program.cs
18
18
```
19
19
@@ -25,7 +25,7 @@ A [magic square](https://en.wikipedia.org/wiki/Magic_square) is a square matrix
25
25
26
26
The following is an example of a magic square:
27
27
28
-
```
28
+
```{download="./code/projects/MagicSquare.zip"}
29
29
!include`snippetStart="// Examples courtesy of https://en.wikipedia.org/wiki/Magic_square", snippetEnd="// Check by hand that this square is indeed magic!"` code/projects/MagicSquare/MagicSquare/Program.cs
30
30
```
31
31
@@ -47,7 +47,7 @@ $$2+7+6=15$$
47
47
48
48
A method to return `true` if the 2d-matrix of `int` passed as an argument is a magic square is as follows:
!include`snippetStart="// Method to display 2-d arrays", snippetEnd="// End of method to display 2-d arrays"` code/projects/2DarrayExercise/2DarrayExercise/Program.cs
121
121
```
122
122
</details>
123
123
@@ -183,7 +183,7 @@ tags:
183
183
#. Write a program that "rotate" a 2-dimensional array 90° clockwise. For example, the array
184
184
185
185
```
186
-
!include`snippetStart="// Example array1", snippetEnd="// End of example array1"` code/snippets/2darrays.cs
186
+
!include`snippetStart="// Example array1", snippetEnd="// End of example array1"` code/projects/2DarrayExercise/2DarrayExercise/Program.cs
187
187
```
188
188
189
189
would become
@@ -195,8 +195,8 @@ tags:
195
195
```
196
196
197
197
<details>
198
-
<summary>Solution</summary>```
199
-
!include`snippetStart="// Method to rotate an array 90° clockwise", snippetEnd="// End of method to rotate an array 90° clockwise"` code/snippets/2darrays.cs
!include`snippetStart="// Method to rotate an array 90° clockwise", snippetEnd="// End of method to rotate an array 90° clockwise"` code/projects/2DarrayExercise/2DarrayExercise/Program.cs
0 commit comments