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

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    60

    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....
    please visit www.asciitable.com

    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. #2
    Registered User
    Join Date
    Jun 2003
    Posts
    60

    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. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    61
    gotoxy isn't part of stdio.h header, but rather a proprietary function supplied by some compilers in conio.h.
    $ENV: FreeBSD, gcc, emacs

  4. #4
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    i havnt tried this on, i think ill try it. is the box supposed to be a outline or filled in?

  5. #5
    Registered User
    Join Date
    Jun 2003
    Posts
    60

    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. #6
    Registered User
    Join Date
    Jun 2003
    Posts
    60

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

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

    Oh my, Please disregard it.....

    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. #7
    Registered User
    Join Date
    Jun 2003
    Posts
    124
    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.
    Loading.....
    ( Trying to be a good C Programmer )

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem I Can't solve...
    By ferniture in forum C Programming
    Replies: 3
    Last Post: 07-15-2008, 02:51 AM
  2. Array print problem
    By nixonbw in forum C Programming
    Replies: 2
    Last Post: 03-19-2008, 09:17 AM
  3. Print out first N lines
    By YoYayYo in forum C Programming
    Replies: 1
    Last Post: 02-21-2008, 12:58 AM
  4. Problem With search a file and printing to screen
    By sell682 in forum C++ Programming
    Replies: 4
    Last Post: 05-02-2004, 05:55 AM
  5. print problem
    By maloy in forum C++ Programming
    Replies: 2
    Last Post: 10-05-2002, 10:43 PM