Copyright (c) 1980 The Regents of the University of California.
All rights reserved.
%sccs.include.redist.roff%
@(#)appen.A 6.6 (Berkeley) 01/14/93
.eh 'PS1:18-%''\*(Ln Appendix A' .bp .(x .b "Appendix A" .)x .sh 1 "Examples" 1 .pp Here we present a few examples of how to use the package. They attempt to be representative, though not comprehensive. Further examples can be found in the games section of the source tree and in various utilities that use the screen such as .i systat(1) . .pp The following examples are intended to demonstrate the basic structure of a program using the basic functions of the package. .sh 2 "Simple Character Output" .pp This program demonstrates how to set up a window and output characters to it. Also, it demonstrates how one might control the output to the window. If you run this program, you will get a demonstration of the character output chracteristics discussed in the above Character Output section. .(l I .so ex1.gr .)l .sh 2 "A Small Screen Manipulator" .pp The next example follows the lines of the previous one but extends then to demonstrate the various othe uses of the package. Make sure you understand how this program works as it encompasses most of anything you will need to do with the package. .(l I .so ex2.gr .)l .sh 2 "Twinkle" .pp This is a moderately simple program which prints patterns on the screen. It switches between patterns of asterisks, putting them on one by one in random order, and then taking them off in the same fashion. It is more efficient to write this using only the motion optimization, as is demonstrated below. .(l I .so twinkle1.gr .)l
All rights reserved.
%sccs.include.redist.roff%
@(#)appen.A 6.6 (Berkeley) 01/14/93
.eh 'PS1:18-%''\*(Ln Appendix A' .bp .(x .b "Appendix A" .)x .sh 1 "Examples" 1 .pp Here we present a few examples of how to use the package. They attempt to be representative, though not comprehensive. Further examples can be found in the games section of the source tree and in various utilities that use the screen such as .i systat(1) . .pp The following examples are intended to demonstrate the basic structure of a program using the basic functions of the package. .sh 2 "Simple Character Output" .pp This program demonstrates how to set up a window and output characters to it. Also, it demonstrates how one might control the output to the window. If you run this program, you will get a demonstration of the character output chracteristics discussed in the above Character Output section. .(l I .so ex1.gr .)l .sh 2 "A Small Screen Manipulator" .pp The next example follows the lines of the previous one but extends then to demonstrate the various othe uses of the package. Make sure you understand how this program works as it encompasses most of anything you will need to do with the package. .(l I .so ex2.gr .)l .sh 2 "Twinkle" .pp This is a moderately simple program which prints patterns on the screen. It switches between patterns of asterisks, putting them on one by one in random order, and then taking them off in the same fashion. It is more efficient to write this using only the motion optimization, as is demonstrated below. .(l I .so twinkle1.gr .)l