a Program to print "Big Letters"

I need help writing a program where I use small letter to write names in Big letters. (I dont know if you understand what i mean). Follow link to description.


https://www.dropbox.com/s/n5g1t3ajy7mtu1z/Description.docx
If I were you I would write a class that takes a letter say 'A' and writes a big letter to stdout. Obviously you would need to work out how to do it but at least it would be re-usable, so you wouldn't have to write similar code for each letter.

Have a bash at it and see where it takes you. Any problems, then report back here with a snippet of your code and description of the problem you have.
Maybe create a class that can kind of replicate a 7-segment display (but since you're using letter, not just numbers you might want a few more segments).


//============\\
|| \\       // ||
||  \\     //  ||
||   \\   //   ||
||====\\=//====||
||    // \\    ||
||   //   \\   ||
||  //     \\  ||
|| //       \\ ||
\\============//


I imagine something like that should cover most upper case letters and numbers (I'm sure you can figure something out if it doesn't), You'd still need to create a derived/instance for each letter but at least there's less work in doing this.


//============\\
||            ||
||            ||
||            ||
||============||
||      \\
||       \\
||        \\
||         \\


P.S. There are special ASCII characters that you can use just to create white squares on the console if you'd rather draw something like this asif it's pixels rather than characters.
Last edited on
From the document the OP included as a link, the definitions for letters have been provided in the file HW13-BigLetteres.txt; in 9 x 9 matrix format. e.g.

 AAAAAAA
A       A
A       A
AAAAAAAAA
A       A
A       A
A       A
A       A


So step 1 is to read the data from the file into suitable storage. An array of "Letter" classes, maybe? Or just a data array, if classes haven't been covered yet. Or even a vector??

Step 2 would be to write out a single letter (using loops) at a time

Step 3 to modify it to handle a string of letters on one line

And maybe add line wrapping for longer strings as step 4?

Andy
Last edited on
In order to handle an string you've got several options
1. maintain a matrix that represents your display. Write all the letters there, then print the matrix.
a. move the cursor with `gotoxy()' functions, you'll need to use a library like ncurses.
\alpha. work as with scanlines. Traverse the string and print the top line of each letter, then the second line of each letter, and so on.


> From the document the OP included as a link
It was a *.docx. There wasn't a good reason to use such format.
The example input/output would be better seen as text than an image (I understand that that may not be your fault, complain for me)
I've actually done something like this, but with numbers instead of letters:

http://www.mediafire.com/view/bso2ihd6i3xnbps/Digital.cpp
From the document the OP included as a link, the definitions for letters have been provided in the file HW13-BigLetteres.txt; in 9 x 9 matrix format. e.g.

AAAAAAA
A A
A A
AAAAAAAAA
A A
A A
A A
A A


So step 1 is to read the data from the file into suitable storage. An array of "Letter" classes, maybe? Or just a data array, if classes haven't been covered yet. Or even a vector??

Step 2 would be to write out a single letter (using loops) at a time

Step 3 to modify it to handle a string of letters on one line

And maybe add line wrapping for longer strings as step 4?

Andy




I still have no clue how to read the file & make it display the information i want
Topic archived. No new replies allowed.