output formatting

Hi everybody, I dont know why my output comes out all weird, maybe its because i have had a long day i dont know. I just want it to come out has it is in the function but its always off. Thanks for any help.

edit: if you copy and paste it, it should be lined up.

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
34
35
36
37
38
39
40
41
42

#include<iostream>

using namespace std;

void begining();
void ending();
void hanoi(int n);

const int discs = 5;
const int pegs = 3;

int main()
{
	cout << "Tower of Hanoi:" << endl;
	cout << endl;

	cout << "In the begining the 3 towers appears as follows:" << endl;
	cout << endl;

	begining();

	return 0;
}

void begining()
{
	cout << "		_		" << " " << "		_		" << endl;
	cout << "	   | |		" << " " << "	   | |		" << endl;
	cout << "	   | |		" << " " << "	   | |		" << endl;
	cout << "	   ---		" << " " << "	   | |		" << endl;
	cout << "	  | 1 |		" << " " << "	   | |		" << endl;
	cout << "	  -----		" << " " << "	   | |		" << endl;
	cout << "	 |  2  |	" << " " << "	   | |		" << endl;
	cout << "	 -------	" << " " << "	   | |		" << endl;
	cout << "	|   3   |	" << " " << "	   | |		" << endl;
	cout << "	---------	" << " " << "	   | |		" << endl;
	cout << "  |	4	 |	" << " " << "	   | |		" << endl;
	cout << "  -----------	" << " " << "	   | |		" << endl;
	cout << " |		5	  |	" << " " << "	   | |		" << endl;
}
Last edited on
You're using tabs, and your tab size is different to that of your shell.
Topic archived. No new replies allowed.