Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void display(char filename[], int b_map[][50], int f_map[50][50], char c_map[50][50], int width, int height)
- {
- //variables
- int l;
- //output title
- cout << "-----" << filename << "-----" << endl;
- if (width > 9)
- {
- //start with a blank space for formatting
- cout << " ";
- //for the entire width,
- for (l = 0; l < width; l++)
- {
- //if the current position is under 0, output ' '
- if (l <= 10)
- {
- cout << " ";
- }
- //output first line of the header
- else
- {
- //otherwise output position / 10 with cout
- cout << l / 10;
- }
- }
- cout << endl;
- }
- //start with a blank space for formatting
- cout << " ";
- //output the second line of the header
- for (int i = 0; i < width; i++)
- {
- //for the entire width, output position %10 with cout
- cout << i % 10;
- }
- cout << endl;
- //for each tile, use cout_color() to output its character and given background and foreground
- for (int h = 0; h < height; h++)
- {
- //at the beginning of each row, output the row number with width 2
- //if the current position is under 0, output ' '
- if (h < 10)
- {
- cout << " " << h;
- }
- else
- {
- cout << h;
- }
- for (int w = 0; w < width; w++)
- {
- cout_color(f_map[h][w], b_map[h][w], c_map[h][w]);
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement