-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
72 lines (59 loc) · 1.46 KB
/
Copy pathmain.cpp
File metadata and controls
72 lines (59 loc) · 1.46 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <iostream>
#include <string>
#include <map>
#include <utility>
#include <vector>
#include <cmath>
#include "Globals.h"
#include "Array2D.h"
#include "Array2D.cpp"
#define SIZE 4
using namespace std;
void search(Array2D<char> const& array, string strArray[SIZE])
{
StrLocMap foo;
LocationData ld[SIZE];
for (int i = 0; i < SIZE; ++i)
foo.insert(make_pair(strArray[i],ld[i]));
wsSolve(array, foo);
for (int i = 0; i < SIZE; ++i)
{
cout << strArray[i] << endl;
cout << foo[strArray[i]].coord.pX << ", ";
cout << foo[strArray[i]].coord.pY << endl;
cout << foo[strArray[i]].dir.dX << ", ";
cout << foo[strArray[i]].dir.dY << endl << endl;
}
}
int main()
{
Array2D<char> test(6, 3);
test(0, 0) = 'C';
test(1, 0) = 'A';
test(2, 0) = 'P';
test(3, 0) = 'P';
test(4, 0) = 'L';
test(5, 0) = 'E';
test(0, 1) = 'B';
test(1, 1) = 'A';
test(2, 1) = 'P';
test(3, 1) = 'P';
test(4, 1) = 'P';
test(5, 1) = 'L';
test(0, 2) = 'X';
test(1, 2) = 'L';
test(2, 2) = 'A';
test(3, 2) = 'P';
test(4, 2) = 'P';
test(5, 2) = 'Q';
for (int y = 0; y < 3; ++y)
{
for (int x = 0; x < 6; ++x)
{
cout << test(x, y) << " ";
}
cout << endl;
}
string foo[SIZE] = {"CAPPLE", "BAPPPL", "XLAPPQ", "APP"};
search(test, foo);
}