|
@@ -56,7 +56,7 @@ The only commands the robot understands are:
|
56
|
56
|
6. Display the results on the screen.
|
57
|
57
|
|
58
|
58
|
|
59
|
|
-## Objects and methods
|
|
59
|
+## Objects and Methods
|
60
|
60
|
|
61
|
61
|
The following is the `main` function of a basic program like the one you will be creating. During the laboratory experience you only need to program the `main` function (within the `main.cpp` file). The rest of the files contain functions that implement the functionality of the instructions the robot understands.
|
62
|
62
|
|
|
@@ -90,7 +90,7 @@ int main(int argc, char *argv[]) {
|
90
|
90
|
|
91
|
91
|
```
|
92
|
92
|
|
93
|
|
-**Figure 2** Example of the `main` function.
|
|
93
|
+**Figure 2** Example of the `main` Function.
|
94
|
94
|
|
95
|
95
|
---
|
96
|
96
|
|
|
@@ -145,7 +145,7 @@ In the example, the code is trying to move the robot as many times as it can tow
|
145
|
145
|
|
146
|
146
|
## Laboratory Session
|
147
|
147
|
|
148
|
|
-### Exercise 1 - Square grid
|
|
148
|
+### Exercise 1 - Square Grid
|
149
|
149
|
|
150
|
150
|
Suppose that the robot is currently in the upper left room (northwest) of a **square** space of rooms, i.e. the space contains the same number of rows and columns of rooms (like the one in Figure 1). Design an algorithm that allows the robot to compute the number of rooms that there are in the grid.
|
151
|
151
|
|
|
@@ -167,7 +167,7 @@ Suppose that the robot is currently in the upper left room (northwest) of a **sq
|
167
|
167
|
6. Once you have finished your algorithm, and made it correct and efficient, hand it in using Deliverable 1 in Moodle. On the algorithm's header, write and explain the expression you found about the number of rooms the robot should visit to complete its task for a grid of size $$n \times n$$ (For example, "The robot takes 2x+5 steps, 5 to arrive at the middle and 2n to count the rest").
|
168
|
168
|
|
169
|
169
|
|
170
|
|
-### Exercise 2 - Rectangular grid
|
|
170
|
+### Exercise 2 - Rectangular Grid
|
171
|
171
|
|
172
|
172
|
**Instructions**
|
173
|
173
|
|
|
@@ -179,7 +179,7 @@ Suppose that the robot is currently in the upper left room (northwest) of a **sq
|
179
|
179
|
|
180
|
180
|
4. Hand in the `main.cpp` file with the code to calculate the number of rooms in a rectangular grid using Deliverable 2 in Moodle.
|
181
|
181
|
|
182
|
|
-### Exercise 3 - Rectangular grid, random position
|
|
182
|
+### Exercise 3 - Rectangular Grid, Random Position
|
183
|
183
|
|
184
|
184
|
**Instructions**
|
185
|
185
|
|
|
@@ -193,7 +193,7 @@ Suppose that the robot is currently in the upper left room (northwest) of a **sq
|
193
|
193
|
|
194
|
194
|
|
195
|
195
|
|
196
|
|
-### Exercise 4 - Pyramid grid, random position
|
|
196
|
+### Exercise 4 - Pyramid Grid, Random Position
|
197
|
197
|
|
198
|
198
|
**Instructions**
|
199
|
199
|
|