-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolours.cpp
More file actions
53 lines (37 loc) · 1.02 KB
/
Copy pathcolours.cpp
File metadata and controls
53 lines (37 loc) · 1.02 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
49
50
51
52
53
#include "colours.h"
std::vector<int> getCellColour(int currentCell){
std::vector<int> rgbVector;
if (currentCell==DEFAULT){
rgbVector = {255,255,255};
}
else if (currentCell == WALL)
{
rgbVector = {20,20,20};
}
else if (currentCell == TARGET)
{
rgbVector = {255,0,0};
}
else if (currentCell == START){
rgbVector= {0,0,255};
}
else if (currentCell == SEEN){
rgbVector= {255,0,255};
}
else if (currentCell == PATH){
rgbVector= {255,255,0};
}
return rgbVector;
}
std::vector<std::vector<int>> drawCoords(std::vector<std::vector<int>>& grid, const std::vector<std::vector<int>> &coordVector, const int& COLOUR, const std::vector<int> &startCoords, const std::vector<int> &targetCoords){
for(auto coord: coordVector){
if(coord == startCoords){
continue;
}
if(coord == targetCoords){
continue;
}
grid[coord[1]][coord[0]] = COLOUR;
}
return grid;
}