#include "color_map.h" std::ostream& operator<<(std::ostream& out, color c) { switch (c.hue) { case red: out << "red"; break; case blue: out << "blue"; break; case green: out << "green"; break; case yellow: out << "yellow"; break; case none: out << "none"; } return out; } map::map() { for (int i = 0; i < max_MAP_SIZE; i++) { coloring[i] = none; for (int j = 0; j < max_MAP_SIZE; j++) neighbor[i][j] = false; } } bool map::isValidColoring(int country, color c) { for (int i = 0; i < numOfCountries; i++) { if (neighbor[country][i] == true && coloring[i] == c) return false; } return true; } std::istream& operator>> (std::istream& in, map& m) { in >> m.numOfCountries; for (int i = 0; i < m.numOfCountries; i++) { for (int j = 0; j < m.numOfCountries; j++) { int tmp; in >> tmp; if (tmp == 1) m.neighbor[i][j] = true; else m.neighbor[i][j] = false; } } return in; } std::ostream& operator<< (std::ostream& out, map& m) { for (int i = 0; i < m.numOfCountries; i++) out << "Country "<