home *** CD-ROM | disk | FTP | other *** search
- From: marc@praxis.co.uk (Marc Munro)
-
- The following stuff allows go positions to be displayed on a vt220 or
- (good) compatible terminal. It uses vt220 user-defined characters (soft
- fonts) to do this, but as many vt220 emulations do not cope with these,
- it may not work on your site.
-
- In addition to the uuencoded graphics files, there is a set of C
- definitions for the graphic set, an empty board display, and various
- useful vt220 escape sequences. Use them as you will.
-
- There are two uuencoded files included here: defs.vt220 and eg.vt220.
- defs.vt220 contains only definitions of the soft font. eg.vt220 contains
- the definition, and an example display. List this file to your terminal
- to see how it looks and whether it works at all.
-
- The defs.vt220 file defines a soft graphics font starting with the
- character 'a', with a matrix size of 8 * 10, called '**0'.
-
- It defines the following characters:
-
- Position Board Char. White Stone Black Stone
-
- top left corner b l r
- top right corner c m s
- bottom left corner d n t
- bottom right corner e o u
- top line f l r
- bottom line g n t
- left hand side h p v
- right hand side i q w
- middle point j p v
- star (handicap) point k p v
-
- stone off the board x y
-
-
- I find that the board looks best in double-width characters in inverse
- video.
-
- So, to display a board you would:
-
- - list defs.vt220 to your terminal
- - clear the screen
- - for each line of the board
- - set double width on
- - send a few spaces (to center the board)
- - set the screen into inverse video
- - select font '**0'
- - send the characters to display the board line (see below)
- - revert to standard font
- - reset from inverse video
-
- If you wanted to display a full size board, with a line of alternate
- black and white stones running down the middle, and a few stones off the
- board (to indicate prisoners), you would use something like the following
- for the board characters:
-
- bffffffffrffffffffc 5 2
- hjjjjjjjjpjjjjjjjji
- hjjjjjjjjvjjjjjjjji
- hjjkjjjjjpjjjjjkjji
- hjjjjjjjjvjjjjjjjji
- hjjjjjjjjpjjjjjjjji
- hjjjjjjjjvjjjjjjjji
- hjjjjjjjjpjjjjjjjji
- hjjjjjjjjvjjjjjjjji
- hjjkjjjjjpjjjjjkjji
- hjjjjjjjjvjjjjjjjji
- hjjjjjjjjpjjjjjjjji
- hjjjjjjjjvjjjjjjjji
- hjjjjjjjjpjjjjjjjji
- hjjjjjjjjvjjjjjjjji x
- hjjkjjjjjpjjjjjkjji x
- hjjjjjjjjvjjjjjjjji x
- hjjjjjjjjpjjjjjjjji x y
- dggggggggtgggggggge x y
-
- Note that the characters '5' and '2' (representing the number of prisoners)
- appear as ordinary text because they are not part of the graphics font.
-
-
- /* Here are the C definitions. */
-
- static char *char_def [] =
- {
- "\033P2;65;2;5{**0", "OOOOOOOO/????????;", "???oOOOO/???N????;",
- "OOOo????/???N????;", "???^OOOO/????????;", "OOO^????/????????;",
- "OOOoOOOO/???N????;", "OOO^OOOO/????????;", "???~OOOO/???N????;",
- "OOO~????/???N????;", "OOO~OOOO/???N????;", "OOw~wOOO/???N????;",
- "{AAAAA{O/@AAMAA@?;", "{AAAAA{?/@AAMAA@?;", "{AABAA{O/@AAAAA@?;",
- "{AABAA{?/@AAAAA@?;", "{AABAA{O/@AAMAA@?;", "{AABAA{?/@AAMAA@?;",
- "{}}}}}{O/@BBNBB@?;", "{}}}}}{?/@BBNBB@?;", "{}}~}}{O/@BBBBB@?;",
- "{}}~}}{?/@BBBBB@?;", "{}}~}}{O/@BBNBB@?;", "{}}~}}{?/@BBNBB@?;",
- "{AAAAA{?/@AAAAA@?;", "{}}}}}{?/@BBBBB@?", "\033\\"
- }; /* Define the graphic character set. */
-
- static char *board_19 [] =
- {
- "bfffffffffffffffffc", "hjjjjjjjjjjjjjjjjji", "hjjjjjjjjjjjjjjjjji",
- "hjjkjjjjjkjjjjjkjji", "hjjjjjjjjjjjjjjjjji", "hjjjjjjjjjjjjjjjjji",
- "hjjjjjjjjjjjjjjjjji", "hjjjjjjjjjjjjjjjjji", "hjjjjjjjjjjjjjjjjji",
- "hjjkjjjjjkjjjjjkjji", "hjjjjjjjjjjjjjjjjji", "hjjjjjjjjjjjjjjjjji",
- "hjjjjjjjjjjjjjjjjji", "hjjjjjjjjjjjjjjjjji", "hjjjjjjjjjjjjjjjjji",
- "hjjkjjjjjkjjjjjkjji", "hjjjjjjjjjjjjjjjjji", "hjjjjjjjjjjjjjjjjji",
- "dggggggggggggggggge"
- };
-
- /* General screen control strings. */
-
- /* Assign US-ASCII to charset G0 and soft-font '**0' to charset G1. */
- static char *assign_sets = {"\033(B\033)**0"};
-
- static char *clear_screen = "\033[2J";
- static char *double_width = "\033#6";
- static char *position_curs = "\033[%d;%dH"; /* See below. */
- static char *save_curs = "\0337";
- static char *reset_curs = "\0338";
- static char *scroll_off = "\033[21;0r"; /* Make top 21 lines */
- /* non-scrolling. */
- static char *scroll_on = "\033[?0;0r";
- static char *graphics_on = "\016"; /* Select charset G1 */
- static char *ascii_on = "\017"; /* Select charset G0 */
- static char *inverse_on = "\033[7m";
- static char *inverse_off = "\033[27m";
- static char *flash_on = "\033[5;1m";
- static char *flash_off = "\033[25;22m";
- static char *reset_term = "\033[!p";
-
- /* use printf (position_curs, coord_1, coord_2) to position the cursor! */
-
-
- Finally, here are the uuencoded files.
-
- BEGIN defs.vt220 ---- cut here ------
- begin 644 defs.vt220
- M&U R.S8U.S([-7LJ*C!/3T]/3T]/3R\_/S\_/S\_/SL_/S]O3T]/3R\_/S].
- M/S\_/SM/3T]O/S\_/R\_/S]./S\_/SL_/S]>3T]/3R\_/S\_/S\_/SM/3T]>
- M/S\_/R\_/S\_/S\_/SM/3T]O3T]/3R\_/S]./S\_/SM/3T]>3T]/3R\_/S\_
- M/S\_/SL_/S]^3T]/3R\_/S]./S\_/SM/3T]^/S\_/R\_/S]./S\_/SM/3T]^
- M3T]/3R\_/S]./S\_/SM/3W=^=T]/3R\_/S]./S\_/SM[04%!04%[3R] 04%-
- M04% /SM[04%!04%[/R] 04%-04% /SM[04%"04%[3R] 04%!04% /SM[04%"
- M04%[/R] 04%!04% /SM[04%"04%[3R] 04%-04% /SM[04%"04%[/R] 04%-
- M04% /SM[?7U]?7U[3R] 0D).0D) /SM[?7U]?7U[/R] 0D).0D) /SM[?7U^
- M?7U[3R] 0D)"0D) /SM[?7U^?7U[/R] 0D)"0D) /SM[?7U^?7U[3R] 0D).
- <0D) /SM[?7U^?7U[/R] 0D).0D) /QM< H*"D)
-
- end
- END ----- cut here ------
-
- BEGIN eg.vt220 ---- cut here ------
- begin 644 eg.vt220
- M&U R.S8U.S([-7LJ*C!/3T]/3T]/3R\_/S\_/S\_/SL_/S]O3T]/3R\_/S].
- M/S\_/SM/3T]O/S\_/R\_/S]./S\_/SL_/S]>3T]/3R\_/S\_/S\_/SM/3T]>
- M/S\_/R\_/S\_/S\_/SM/3T]O3T]/3R\_/S]./S\_/SM/3T]>3T]/3R\_/S\_
- M/S\_/SL_/S]^3T]/3R\_/S]./S\_/SM/3T]^/S\_/R\_/S]./S\_/SM/3T]^
- M3T]/3R\_/S]./S\_/SM/3W=^=T]/3R\_/S]./S\_/SM[04%!04%[3R] 04%-
- M04% /SM[04%!04%[/R] 04%-04% /SM[04%"04%[3R] 04%!04% /SM[04%"
- M04%[/R] 04%!04% /SM[04%"04%[3R] 04%-04% /SM[04%"04%[/R] 04%-
- M04% /SM[?7U]?7U[3R] 0D).0D) /SM[?7U]?7U[/R] 0D).0D) /SM[?7U^
- M?7U[3R] 0D)"0D) /SM[?7U^?7U[/R] 0D)"0D) /SM[?7U^?7U[3R] 0D).
- M0D) /SM[?7U^?7U[/R] 0D).0D) /QM< !LH0ALI*BHP#AM;,C=M"AM;,DH.
- M&R,V(" @(" @(" @&ULW;6)F9F9F9F9F9F9F9F9F9F9F9F,*&ULR-VT;(S8@
- M(" @(" @(" ;6S=M:&IJ:FIJ:FIJ:FIJ:FIJ:FIJ:0H;6S(W;1LC-B @(" @
- M(" @(!M;-VUH:FIP:FIJ:FIJ:FIJ:G9J:FII"AM;,C=M&R,V(" @(" @(" @
- M&ULW;6AJ:FMP:FIJ:FMJ:FIJ:FMV:FD*&ULR-VT;(S8@(" @(" @(" ;6S=M
- M:&IV:FIJ:FIJ:FIJ:FIJ:FIJ:0H;6S(W;1LC-B @(" @(" @(!M;-VUH:FIJ
- M:FIJ:FIJ:FIJ:FIJ:FII"AM;,C=M&R,V(" @(" @(" @&ULW;6AJ:FIJ:FIJ
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