Printing blocks of asterisks as text

I am trying to print out blocks of text using asterisks. I know how to do that but when it prints out it is all done vertically. I would like for it to print out horizontally instead like a line of text.

The code below is how I'm trying to do it but it seems like the function calls in main() can't be manipulated to print out horizontally.

Also, I was told of sites that can do this for me instead but I don't know any names of the sites. If you know of any can you tell me?

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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
  // program will print "MISSISSIPPI" in block letters using asteriks
#include <iostream>
using namespace std;

void M(); //the following does not return a int to the main function
void I();
void S();
void P();

int main()
{
	M(); // will be what is printed onto the screen
	I();
	S();
	S();
	I();
	S();
	S();
	I();
	P();
	P();
	I();
	


	system ("pause");
	return 0;
}


void M()
{
	cout<<"*   *\n"; // the block "M" asterik
	cout<<"** **\n";
	cout<<"* * *\n";
	cout<<"*   *\n\n";
}
void I()
{
	cout<<"****\n"; //the block "I" asterik
	cout<<" *\n";
	cout<<" *\n";
	cout<<" *\n";
	cout<<"****\n\n";

}

void S()
{
	cout<<"*****\n"; //the block "S" asterik
	cout<<"*\n";
	cout<<"*****\n";
	cout<<"    *\n";
	cout<<"*****\n\n";
}

void P()
{
	cout<<"*****\n"; //the block "P" asterik
	cout<<"*   *\n";
	cout<<"*****\n";
	cout<<"*\n";
	cout<<"*\n";
	cout<<"*\n\n";
}





Yeah, printing it out horizontally isn't quite as easy as printing it out vertically.
You'd have to print the whole thing (all letters together) row by row, since there's no (standard) way (as far as I can tell) of "backing up" the cursor after you've printed something.

You could possibly try considering each letter as a 5x5 block (where some characters are asterisks and the rest are spaces) which is just 5 rows of 5 characters each, like this:
*---*
**-**
*-*-*
*---*
*---*

(Here the dashes represent the spaces.)
You want to take all of your letters and "glue" them together (in a sense), which basically means you just "glue" the top rows of all of the characters, then the second row, then the third, and so on.
Then you print each of the glued-together rows:
*---*  *****  *****  *****  *****  *****  *****  *****  *****  *****  *****
**-**  --*--  *----  *----  --*--  *----  *----  --*--  *---*  *---*  --*--
*-*-*  --*--  *****  *****  --*--  *****  *****  --*--  *****  *****  --*--
*---*  --*--  ----*  ----*  --*--  ----*  ----*  --*--  *----  *----  --*--
*---*  *****  *****  *****  *****  *****  *****  *****  *----  *----  *****

An easier way, if you just need it to say "MISSISSIPPI", would be to just copy/paste that thing above (replacing dashes with spaces) and put it in one big cout statement.
But then again, that wouldn't be any fun now, would it? :)
Topic archived. No new replies allowed.