Steps for this Lab:
# set environmental variable and access alias for XTANGO
setenv XENVIRONMENT /u2/walker/parallel/xtango/xtango.res
alias xtango "/u2/walker/parallel/xtango/animator/animator"
The XTANGO program now should be accessible within every new hpterm window you
open (including any future logins).
~walker/parallel/sr/examples/julia-test | xtango
The first part of this command simply runs my program. The vertical line
specifies that the output of my program will go directly into
xtango. (In Unix jargon, you have piped the output of my
julia-test into xtango.)
If all runs correctly, a new window will appear on your screen. When you
click the
run animation button, a rough picture of the Julia set
should appear.
(If you get an error message that xtango is an unknown command or if an XTANGO window opens without a run animation button, be sure that you have added the above lines to your .cshrc file, that you have saved those changes, and that you are running in an hpterm window that was created after the changes to .cshrc were saved. If trouble persists, contact the instructor.)
~walker/parallel/sr/examples/julia-test | moreThis command pipes the output of julia-test into a keyboard display program more. (Alternatively, you could use pg in place of more.) more displays output a screen at a time. Hit the return key to advance the output a line at a time. Hit the space bar to move the the next screen.
julia-test first specifies the overall coordinates for XTANGO's display box, and then the background color is set to white. Next, titles are printed in the display. The remaining lines indicate specific rectangles are to be printed in designated colors. Details of each command are given in Section 2.7 of Hartley's book.
XTANGO works by keeping track of specific graphical objects by number, and each object must have a unique number. (The numbers, however, need not be sequential.) Thus, the second data item in each line for XTANGO is an identification number generated by the program.
example > program-output
Print a copy of this output, and annotate how each line or series of
related lines is interpreted by XTANGO.
const num_colors := 8
var colors [0:num_colors]: string[10]
colors[0] := "black"
colors[1] := "white"
colors[2] := "lightblue"
colors[3] := "red"
colors[4] := "cyan"
colors[5] := "green"
colors[6] := "orange"
colors[7] := "maroon"
colors[8] := "lightpink"
With such an array, each value of results[i, j] could designate a
specific color, or a range of values in results[i, j] could map to
a specified color. Thus, a color for position (i, j) might be printed with
either of the following expressions:
writes(colors[results[i, j]] ) #choice 1: 1 value per color
writes(colors[(results[i, j]+2)/3]) #choice 2: 3 values per color
In either approach, it is suggested that you set the background color to
colors[1]. Also, to save time, only print squares for colors
other than this background color.
For a complete set of possible colors, see /usr/lib/X11/rgb.txt .
Work to be turned in:
This document is available on the World Wide Web as
http://www.math.grin.edu/~walker/courses/295/lab5.html