#include #include using namespace std; using coordinate = std::pair; using hexagon = std::string; int main() { Tile b1{"b1"}; b1.create_hexagon(coordinate{0, 0}, hexagon{"HXOX"}); b1.print_hexagon(coordinate{0, 0}); b1.push(coordinate{0, 0}, 'O'); b1.create_hexagon(coordinate{0, 1}, hexagon{"OXXXH"}); b1.print_tile(); } // coordinate och hexagon som används i huvudprogrammet ovan // är egentligen bara smeknamn för std::pair och // std::string. Se using-direktiven på rad 8 och 9. // Om man inte använde using för coordinate och hexagon ovan // så skulle huvudprogrammet se ut på följande sätt: // int main() // { // Tile b1{"b1"}; // b1.create_hexagon(pair{0, 0}, string{"HXOX"}); // b1.print_hexagon(pair{0, 0}); // b1.push(pair{0, 0}, 'O'); // b1.create_hexagon(pair{0, 1}, string{"OXXXH"}); // b1.print_tile(); // }