Commit | Line | Data |
---|---|---|
ad787160 C |
1 | .\" Copyright (c) 1980, 1993 |
2 | .\" The Regents of the University of California. All rights reserved. | |
3 | .\" | |
c0567266 KB |
4 | .\" Redistribution and use in source and binary forms, with or without |
5 | .\" modification, are permitted provided that the following conditions | |
6 | .\" are met: | |
7 | .\" 1. Redistributions of source code must retain the above copyright | |
8 | .\" notice, this list of conditions and the following disclaimer. | |
9 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer in the | |
11 | .\" documentation and/or other materials provided with the distribution. | |
12 | .\" 3. All advertising materials mentioning features or use of this software | |
13 | .\" must display the following acknowledgement: | |
14 | .\" This product includes software developed by the University of | |
15 | .\" California, Berkeley and its contributors. | |
16 | .\" 4. Neither the name of the University nor the names of its contributors | |
17 | .\" may be used to endorse or promote products derived from this software | |
18 | .\" without specific prior written permission. | |
19 | .\" | |
20 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
21 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
22 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
23 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
24 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
25 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
26 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
27 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
28 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
30 | .\" SUCH DAMAGE. | |
ad787160 C |
31 | .\" |
32 | .\" @(#)appen.A 8.1 (Berkeley) 6/8/93 | |
33 | .\" | |
34 | .ie t .oh '\*(Ln Appendix A''PS1:19-%' | |
35 | .eh 'PS1:19-%''\*(Ln Appendix A' | |
36 | .el .he ''\fIAppendix A\fR'' | |
37 | .bp | |
38 | .(x | |
39 | .ti 0 | |
40 | .b "Appendix A" | |
41 | .)x | |
42 | .sh 1 "Examples" 1 | |
43 | .pp | |
44 | Here we present a few examples | |
45 | of how to use the package. | |
46 | They attempt to be representative, | |
47 | though not comprehensive. Further examples can be found in the games section | |
48 | of the source tree and in various utilities that use the screen such as | |
49 | .i systat(1) . | |
50 | .pp | |
51 | The following examples are intended to demonstrate | |
52 | the basic structure of a program | |
53 | using the package. An additional, more comprehensive, program can be found in | |
54 | the source code in the | |
55 | \fIexamples\fP subdirectory. | |
56 | .sh 2 "Simple Character Output" | |
57 | .pp | |
58 | This program demonstrates how to set up a window and output characters to it. | |
59 | Also, it demonstrates how one might control the output to the window. If | |
60 | you run this program, you will get a demonstration of the character output | |
61 | chracteristics discussed in the above Character Output section. | |
62 | .(l I | |
63 | .so ex1.gr | |
64 | .)l | |
65 | .sh 2 "Twinkle" | |
66 | .pp | |
67 | This is a moderately simple program which prints | |
68 | patterns on the screen. | |
69 | It switches between patterns of asterisks, | |
70 | putting them on one by one in random order, | |
71 | and then taking them off in the same fashion. | |
72 | It is more efficient to write this | |
73 | using only the motion optimization, | |
74 | as is demonstrated below. | |
75 | .(l I | |
76 | .so twinkle1.gr | |
77 | .)l |