Help with displaying a soon to be map

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
#include <iostream>

using namespace std;


int main()
{
	

	char map[10][24] = {
		"#######################",
		"#                     #",
		"#	            #",
		"#	            #",
		"#   	            #",
		"#		#",
		"#		#",
		"#######################",
    	};

	for(int display = 0; display < 10; display++)
	{
		cout << map[display] << endl;
	}	


	cin.get();
	cin.get();

  
	
}

For me to display this map so its a nice neat rectangle I have to place the hashes in such a weird formation and I was wondering why have I have to so this.
P.S The way I have laid the hashes out in this post is the way it is in my compiler (visual studio 2012); when I copied and paste it in here it was a lot neater.

1
2
3
4
5
6
7
8
9
10
char map[10][24] = {
  "#######################",
  "#                     #",
  "#	              #",
  "#	              #",
  "#   	              #",
  "#		      #",
  "#		      #",
  "#######################",
    	};
(This it just from the copy and paste)
You're mixing tabs and spaces, which is a bad idea as it makes for weirdness.

I recommend not using tabs at all. In fact, you should go in Visual Studio's settings and change it so that it automatically converts tabs to spaces.

With spaces, "what you see is what you get", so they're a lot friendlier.
Haha, thanks :D Never would've thought that it was going to be something that simple
Topic archived. No new replies allowed.