# Thread: HELP !! .. print a "box" problem

1. ## HELP !! .. print a "box" problem

I need some help with this exercise:

I am required to print a box, using the coordinates given by a certain user on the keyboard.

The FIRST (x1,y1) coordinates correspond to the "upper left" hand corner-point of the box, and the SECOND (x2,y2) coordinates correspond to the "lower right" hand corner-point of the box.

It sounds easy right ?? But wait......

The lines (and construction) of the box should not use the traditional characters seen on the keyboard such as "-" or "=" or "*"..., etc...

It must use those Extended ASCII Character Codes... (that, disappointingly, I couldn't type here on the screen)..

But I researched on "www.asciitable.com" and I got their corresponding decimal values..

Here are they:

1. value 213 =(which looks like letter "F")
2. value 212 =(which looks like the vertically inverted letter "F")
3. value 205 =(which looks like the equal "=" sign)
4. value 179 =(which looks like a vertical bar "|" to me)
5. value 190 =(which looks like the mirror image of value 212)
6. value 184 =(which looks like the mirror image of value 213)

If you get confused by my values and descriptions....

those 6 values above not only tied my head in knots but gave me a painful stomach ulcer --"I surrender !"

You dudes are my only chance !!

Thank you for any advice and codes you may share !!!

2. ## one more thing....

We are only on the fresh phases of "C programming"....

We are confined "only" to the library <stdio.h>

And we just finished a lecture on gotoxy() and Function Prototypes.

Perhaps this facts may help.... one way or the other,.. that's the best I could do in expressing everything I have !!

Thanks Again !!

3. gotoxy isn't part of stdio.h header, but rather a proprietary function supplied by some compilers in conio.h.

4. i havnt tried this on, i think ill try it. is the box supposed to be a outline or filled in?

5. ## outline or filled in?

Oi !! mart_man00 !!

First of all, we're using Turbo C on the lab.,...

Im not sure about the meaning of "outline or filled in" ...

But I have a hunch its an Outline of a box...

when you run the program.... you will see a box of the user's choice coordinates... nothing filled inside,.. just a smooth 4-sided box with 2 lines (1 above and 1 below) caused by the "F" ASCII code

It looks somehow like this:
(but this is more rough.. it should be smooth)
_________________________
|---------------------------------------- |
| |
| |
| |
| |
| |
| |
|---------------------------------------- |
|_________________________ |

STATEMENT(1.) The "Box" Im referring to, looks similar to the background of the Turbo C environment when you press F5 to zoom the window..

if you get confused by my statement(1.) ... nevermind it !!

6. ## Oh God... that doesn't look like a box...

Oh sorry.... that's not that box Im referring to....

in any case,.. please share your ideas,.. and on how I would be able to print such ASCII characters on the screen ??

If it were asterisks: it would be a simple:

printf("*");

but how would it be on such characters, which aren't even on my keyboard.......

anyway !! Thanks Dudes !!

7. If your question is how to print these character, you can simply print them using their integral value, like:
printf( "%c", value_Of_Character )

***EDIT***
Salem posted the same thing . Sorry for posting it again.. i just now saw it.