-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
executable file
·84 lines (56 loc) · 1.29 KB
/
test.cpp
File metadata and controls
executable file
·84 lines (56 loc) · 1.29 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
73
74
75
76
77
78
79
80
81
82
83
84
#include <iostream>
#include "SequenceTable.h"
#include "SequenceAnalyzer.h"
#include "JSONSequenceAnalyzer.h"
#include "DanceGenerator.h"
using namespace std;
/*
//Test main
int main(int argc, char* argv[]) {
return 0;
}*/
void TestSequenceTable();
void TestSequenceAnalyzer(string filename);
//Test main
int main(int argc, char* argv[]) {
/*
if (argc < 1) {
cout<<"Usage:\n $ "<<argv[0]<<" <sequence_filename>"<<endl;
return -1;
}
*/
JSONSequenceAnalyzer sa(argv[1]);
sa.printTable(cout);
DanceGenerator dg(sa.getSequenceTable());
char c;
cout<<"Keep pressing enter to spit out a move. Enter '.' to quit."<<endl;
do {
cout<<"Move:"<<dg.currentPos();
if (dg.atBase())
cout<<endl<<"***Reset to base***";
dg.next();
c=getchar();
} while(c != '.');
return 0;
}
void TestSequenceTable() {
cout<< "**Sequence Table Test**"<<endl;
SequenceTable st;
//Add some base positions
st.addBase(100);
st.addBase(101);
st.addBase(102);
//Add some moves
st.addMove(110,111);
st.addMove(110,112);
st.addMove(112,114);
st.addMove(112,115);
st.addMove(114,115);
st.addMove(112,118);
st.print(cout);
}
void TestSequenceAnalyzer(string filename) {
cout<< "**Sequence Analyzer Test**"<<endl;
JSONSequenceAnalyzer s(filename);
s.printTable(cout);
}