-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainTrain.cpp
More file actions
48 lines (35 loc) · 1.09 KB
/
MainTrain.cpp
File metadata and controls
48 lines (35 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include "Grid.h"
using namespace std;
int main()
{
Grid g(4, 2, 3, 2, 0);
if (g.getRectAtIndex(3)->getTopLeftPoint().getX() != 4)
cout << "error in grid creation (-16)" << endl;
if (g.getRectAtIndex(3)->getBottomRightPoint().getY() != 4)
cout << "error in grid creation (-16)" << endl;
Point p1(5, 1);
g.getRectAtPoint(p1)->setColor(2);
if (g.getRectAtIndex(2)->getColor() != 2)
cout << "error in finding point in rect (-16)" << endl;
g.getRectAtIndex(2)->setColor(2);
g.moveGrid(4, 3);
Point p2(10, 3.5);
g.getRectAtPoint(p2)->setColor(2);
if (g.getRectAtIndex(2)->getColor() != 2)
cout << "error in move grid (-16)" << endl;
g.getRectAtIndex(2)->setColor(2);
g.scaleGrid(2, 1);
Point p3(7, 3);
g.getRectAtPoint(p3)->setColor(2);
if (g.getRectAtIndex(5)->getColor() != 2)
cout << "error in scale grid (-16)" << endl;
{
Grid g2(4, 2, 3, 2, 0);
}
if (g.getRectAtIndex(0)->m_count > 6)
cout << "did not clear the memory (-16)" << endl;
cout << "done" << endl;
return 0;
}