-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQwintoRow.cpp
More file actions
43 lines (35 loc) · 1.09 KB
/
QwintoRow.cpp
File metadata and controls
43 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
#include "QwintoRow.h"
//specializations of the insertion operator for template QwintoRow
template <>
void QwintoRow<Color::RED>::print(std::ostream& _out) const
{
_out << "Red ";
for (int i = 0; i < 10; ++i)
{
_out << (((i == 1) || (i == 2) || (i == 5) || (i == 6)) ? '%' : '|'); //this line decides which seperator to place
QwintoRow<Color::RED>::printNumber(_out, d_row[i]);
}
_out << '|' << std::endl;
}
template <>
void QwintoRow<Color::YELLOW>::print(std::ostream& _out) const
{
_out << "Yellow ";
for (int i = 0; i < 10; ++i)
{
_out << (((i == 7) || (i == 8)) ? '%' : '|'); //this line decides which seperator to place
QwintoRow<Color::YELLOW>::printNumber(_out, d_row[i]);
}
_out << '|' << std::endl;
}
template <>
void QwintoRow<Color::BLUE>::print(std::ostream& _out) const
{
_out << "Blue ";
for (int i = 0; i < 10; ++i)
{
_out << (((i == 2) || (i == 3) || (i == 9)) ? '%' : '|'); //this line decides which seperator to place
QwintoRow<Color::BLUE>::printNumber(_out, d_row[i]);
}
_out << '%' << std::endl;
}