|
|
|
|
98
|
|
98
|
|
99
|
The first line creates the only object you should create, an object of the `MainGameWindow` class. The parameter `Mode::SQUARE_TOP_LEFT` specifies that the grid will be square and that the robot will start in the upper left corner. Other options for the parameter are `RECT_TOP_LEFT`, `RECT_RANDOM` and `PYRAMID_RANDOM`.
|
99
|
The first line creates the only object you should create, an object of the `MainGameWindow` class. The parameter `Mode::SQUARE_TOP_LEFT` specifies that the grid will be square and that the robot will start in the upper left corner. Other options for the parameter are `RECT_TOP_LEFT`, `RECT_RANDOM` and `PYRAMID_RANDOM`.
|
100
|
|
100
|
|
101
|
-```cpp
|
|
|
102
|
-MainGameWindow *w = new MainGameWindow(Mode::SQUARE_TOP_LEFT);
|
|
|
103
|
-```
|
|
|
|
|
101
|
+`MainGameWindow *w = new MainGameWindow(Mode::SQUARE_TOP_LEFT);`
|
104
|
|
102
|
|
105
|
The following shows the object `w`.
|
103
|
The following shows the object `w`.
|
106
|
|
104
|
|
107
|
-```cpp
|
|
|
108
|
-w->show();
|
|
|
109
|
-```
|
|
|
|
|
105
|
+`w->show();`
|
110
|
|
106
|
|
111
|
The `void display(QString)` method displays short messages on the screen. For example:
|
107
|
The `void display(QString)` method displays short messages on the screen. For example:
|
112
|
|
108
|
|
113
|
-```cpp
|
|
|
114
|
-w->display("Start");
|
|
|
115
|
-```
|
|
|
|
|
109
|
+`w->display("Start");`
|
116
|
|
110
|
|
117
|
shows the word "Start" before the robot starts to move. The code that follows:
|
111
|
shows the word "Start" before the robot starts to move. The code that follows:
|
118
|
|
112
|
|
|
|
|
|
157
|
|
151
|
|
158
|
1. Load the project `CountingSquares` into `QtCreator`. There are two ways to do this:
|
152
|
1. Load the project `CountingSquares` into `QtCreator`. There are two ways to do this:
|
159
|
|
153
|
|
160
|
- * Using the virtual machine: Double click the file `CountingSquares.pro` located in the folder `/home/eip/labs/repetitions-countingsquares` of your virtual machine.
|
|
|
161
|
- * Downloading the project’s folder from `Bitbucket`: Use a terminal and write the command `git clone http:/bitbucket.org/eip-uprrp/repetitions-countingsquares` to download the folder `repetitions-countingsquares` from `Bitbucket`. Double click the file `CountingSquares.pro` located in the folder that you downloaded to your computer.
|
|
|
|
|
154
|
+ * Using the virtual machine: Double click the file `CountingSquares.pro` located in the folder `/home/eip/labs/repetitions-countingsquares` of your virtual machine.
|
|
|
155
|
+ * Downloading the project’s folder from `Bitbucket`: Use a terminal and write the command `git clone http:/bitbucket.org/eip-uprrp/repetitions-countingsquares` to download the folder `repetitions-countingsquares` from `Bitbucket`. Double click the file `CountingSquares.pro` located in the folder that you downloaded to your computer.
|
162
|
|
156
|
|
163
|
2. Configure the project. The project consists of various files. **You will only write code in the file** `main.cpp`. The rest of the files contain functions that implement the functionality of the instructions the robot can understand.
|
157
|
2. Configure the project. The project consists of various files. **You will only write code in the file** `main.cpp`. The rest of the files contain functions that implement the functionality of the instructions the robot can understand.
|
164
|
|
158
|
|