IUP Computer Science
CO 300 Spring 1999

Project #3
(Due 5 pm 5 March 1999)

Write a program that demonstrates familiarity with the terminal escape sequences by reading in some text and displaying the text in a special way. Specifically . . .

  1. Begin by clearing the screen. Then, prompt for and read in two short lines of data. The prompts for these lines should begin at line 20, column 10 and line 21, column 10; the prompt should not contain a question mark.
  2. Display the combined text from both input lines (with the carriage returns replaced by spaces) in the upper left corner of the screen in red characters. The text must be displayed on the diagonal; to illustrate, consider the following. Suppose that the two input lines are:
          Here is a sentence
          having 40 characters.
This text should be displayed as follows (except in red):
H r i   e a 0 t
e   a t h 4 c            Notes: The display at the left is 
e   n     a              stretched horizontally for readability
s e e g r                on paper - do NOT do this in your
s c n a                  program.  Only the diagonalized text
n i h .                  should be red, not the prompt nor the
v c s                    input text.  When the program finishes,
  r                      the $ prompt should not be red (or blue)
e                        and should appear on line 22.
The total length of the two input lines <= 45 characters. When your program is finished, the prompts, the original text, and the diagonalized text should all appear on the screen.

Hand in a fully commented .LIS listing. Copy your executable program to the HANDIN directory and name the file after yourself. For example, if I had the executable program in P3.EXE in my directory, I would copy it to the HANDIN directory using a command like:

COPY P3.EXE HANDIN:JIMWOLFE.EXE

EXTRA CREDIT:

If you find a way to enhance your program to do either or both of the following, points will be added to your score:

1) Allow the total length of the two input lines to be <= 120 characters;

2) Display alternating diagonal lines in red and blue.