//Excerpt from game.C game::game(char initial_c) : term(initial_c) { static const size_t xmax = 8; //number of columns in the picture static const char a[][xmax + 1] = { //plus 1 for terminating '\0' "bbbbbbbb", //a maze of boulders "b......b", "b.bbbb.b", "b..s.b.b", //The 's' is a sitting duck. "bbbbbb.b", "W......b", //The 'W' is a wolf. "bbbbbbbb" }; static const size_t ymax = sizeof a / sizeof a[0]; for (size_t y = 0; y < ymax; ++y) { for (size_t x = 0; x < xmax; ++x) { if (term.in_range(x, y)) { switch (a[y][x]) { //sorry the y comes before the x case '.': break; case 'b': new boulder(this, x, y); break; case 's': new sitting_duck(this, x, y); break; case 'W': new wolf(this, x, y); break; default: cerr << "bad character '" << a[y][x] << "' at (" << x << ", " << y << ")\n"; exit(EXIT_FAILURE); } } } } }