Module 13: Points and Spans
This commit is contained in:
parent
7e6b501283
commit
fe2d2e391f
27
a.c
27
a.c
@ -33,6 +33,23 @@ ostream& operator<<(ostream& os, const Point& p) { // for printing
|
||||
return os;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
//-Span
|
||||
struct Span {
|
||||
Span(Point p, int l, bool v) : point(p), len(l), vert(v) {}
|
||||
|
||||
friend ostream& operator<<(ostream& os, const Span& s);
|
||||
|
||||
Point point;
|
||||
int len;
|
||||
bool vert;
|
||||
};
|
||||
|
||||
ostream& operator<<(ostream& os, const Span& s) {
|
||||
os << "[" << s.point << " len=" << s.len << " vert=" << s.vert << "]";
|
||||
return os;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------
|
||||
//-Word
|
||||
struct Word {
|
||||
@ -187,8 +204,6 @@ int main() {
|
||||
Library lib;
|
||||
lib.ReadFromFile("top_12000.txt");
|
||||
|
||||
lib.FindWord("D--");
|
||||
|
||||
Grid grid("MY GRID");
|
||||
grid.LoadFromFile("test");
|
||||
grid.Check();
|
||||
@ -199,4 +214,12 @@ int main() {
|
||||
|
||||
cout << "Point1 is " << p1 << "\n";
|
||||
cout << "Point2 is " << p2 << "\n";
|
||||
|
||||
Span s1(p1, 3, true);
|
||||
Span s2(p2, 5, false);
|
||||
|
||||
cout << "Span1 is " << s1 << "\n";
|
||||
cout << "Span2 is " << s2 << "\n";
|
||||
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user