testpat.c revision 1.3 1 1.3 jmcneill /* $NetBSD: testpat.c,v 1.3 2021/01/02 12:12:26 jmcneill Exp $ */
2 1.1 nat
3 1.1 nat /*-
4 1.1 nat * Copyright (c) 2016 Nathanial Sloss <nathanialsloss (at) yahoo.com.au>
5 1.1 nat * All rights reserved.
6 1.1 nat *
7 1.1 nat * Redistribution and use in source and binary forms, with or without
8 1.1 nat * modification, are permitted provided that the following conditions
9 1.1 nat * are met:
10 1.1 nat * 1. Redistributions of source code must retain the above copyright
11 1.1 nat * notice, this list of conditions and the following disclaimer.
12 1.1 nat * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 nat * notice, this list of conditions and the following disclaimer in the
14 1.1 nat * documentation and/or other materials provided with the distribution.
15 1.1 nat *
16 1.1 nat * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17 1.1 nat * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 1.1 nat * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 1.1 nat * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 1.1 nat * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 1.1 nat * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 1.1 nat * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 1.1 nat * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 1.1 nat * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 1.1 nat * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 1.1 nat * POSSIBILITY OF SUCH DAMAGE.
27 1.1 nat */
28 1.1 nat
29 1.1 nat #include <curses.h>
30 1.1 nat #include <err.h>
31 1.1 nat #include <errno.h>
32 1.1 nat #include <math.h>
33 1.1 nat #include <stdio.h>
34 1.1 nat #include <stdlib.h>
35 1.1 nat #include <string.h>
36 1.1 nat #include <time.h>
37 1.1 nat #include <sys/time.h>
38 1.1 nat #include <sys/types.h>
39 1.1 nat
40 1.1 nat int main(int argc, char *argv[]) {
41 1.1 nat int i, col, colour, line, x_limit, y_limit, colourOK, spacing;
42 1.1 nat int xpos, ypos, spacing_residual, spacing_start, spacing_end;
43 1.1 nat int grid_x, grid_y;
44 1.1 nat float grid_unit;
45 1.1 nat
46 1.1 nat char title[255] = "NetBSD";
47 1.1 nat int numcolours = 6;
48 1.1 nat
49 1.1 nat int colour_list[6] = {
50 1.1 nat COLOR_YELLOW,
51 1.1 nat COLOR_CYAN,
52 1.1 nat COLOR_GREEN,
53 1.1 nat COLOR_MAGENTA,
54 1.1 nat COLOR_RED,
55 1.1 nat COLOR_BLUE,
56 1.1 nat };
57 1.1 nat
58 1.1 nat float coord_x, circle_int;
59 1.1 nat float a_axis, b_axis;
60 1.1 nat
61 1.1 nat if (!(initscr())) {
62 1.1 nat printf("\nUnknown terminal type.");
63 1.1 nat printf("\n");
64 1.1 nat return EXIT_FAILURE;
65 1.1 nat }
66 1.3 jmcneill curs_set(0);
67 1.1 nat
68 1.1 nat if (argc > 2) {
69 1.1 nat endwin();
70 1.2 jmcneill errx(EINVAL, "usage: testpat [title]");
71 1.1 nat }
72 1.2 jmcneill
73 1.1 nat if (argc == 2 && strlen(argv[1]) < (size_t)COLS)
74 1.1 nat snprintf(title, sizeof(title), "%s", argv[1]);
75 1.1 nat else if (argc == 2 && (int)strlen(argv[1]) > COLS) {
76 1.1 nat endwin();
77 1.1 nat errx(EINVAL, "title string must be less than display columns");
78 1.1 nat }
79 1.1 nat
80 1.1 nat colourOK = has_colors();
81 1.1 nat
82 1.1 nat if (COLS < 13 || LINES < 13) {
83 1.1 nat endwin();
84 1.1 nat printf("\nTerminal size must be at least 72x25.");
85 1.1 nat printf("\n");
86 1.1 nat return EXIT_FAILURE;
87 1.1 nat }
88 1.1 nat
89 1.1 nat if (colourOK) {
90 1.1 nat start_color();
91 1.2 jmcneill
92 1.1 nat init_pair( 0, COLOR_WHITE, COLOR_BLACK );
93 1.1 nat init_pair( 1, COLOR_WHITE, COLOR_RED );
94 1.1 nat init_pair( 2, COLOR_WHITE, COLOR_GREEN );
95 1.1 nat init_pair( 3, COLOR_WHITE, COLOR_YELLOW );
96 1.1 nat init_pair( 4, COLOR_WHITE, COLOR_BLUE );
97 1.1 nat init_pair( 5, COLOR_WHITE, COLOR_MAGENTA );
98 1.1 nat init_pair( 6, COLOR_WHITE, COLOR_CYAN );
99 1.1 nat init_pair( 7, COLOR_BLACK, COLOR_WHITE );
100 1.1 nat
101 1.1 nat attrset(COLOR_PAIR(0));
102 1.1 nat }
103 1.1 nat
104 1.1 nat x_limit = (COLS - 1) / 2;
105 1.1 nat x_limit = x_limit * 2;
106 1.1 nat y_limit = (LINES - 2) / 2;
107 1.1 nat y_limit = y_limit * 2;
108 1.1 nat spacing = 2 * y_limit / numcolours;
109 1.1 nat spacing_residual = ((2 * y_limit) % numcolours) / 2;
110 1.1 nat a_axis = y_limit / 2;
111 1.1 nat b_axis = y_limit;
112 1.1 nat grid_unit = b_axis / 13;
113 1.1 nat grid_y = grid_unit;
114 1.1 nat grid_x = grid_unit * 2;
115 1.1 nat
116 1.1 nat int circle_pos[y_limit][2];
117 1.1 nat memset(circle_pos, -1, sizeof(circle_pos));
118 1.1 nat
119 1.1 nat for (i = 0; i < y_limit; i++) {
120 1.1 nat /* Draw an elipse (looks more circular.) */
121 1.1 nat circle_int = (i - a_axis) / a_axis;
122 1.1 nat circle_int = 1 - powf(circle_int, 2);
123 1.1 nat circle_int = circle_int * powf(b_axis, 2);
124 1.1 nat #if 0
125 1.1 nat /* Draw a circle, commented out as elipse looks better.*/
126 1.1 nat circle_int = powf(a_axis, 2) - powf(i - a_axis, 2);
127 1.1 nat #endif
128 1.1 nat coord_x = sqrtf(circle_int);
129 1.1 nat circle_pos[i][0] = (-coord_x + ((float)x_limit / 2));
130 1.1 nat circle_pos[i][1] = (coord_x + ((float)x_limit / 2));
131 1.1 nat }
132 1.1 nat
133 1.1 nat clear();
134 1.1 nat
135 1.1 nat attron(A_ALTCHARSET);
136 1.1 nat move(0, 0);
137 1.1 nat
138 1.1 nat /* Draw a grid. */
139 1.1 nat for (line = 1; line < y_limit; line += grid_y) {
140 1.1 nat for (col = 1; col < x_limit; col = col + grid_x) {
141 1.1 nat xpos = col;
142 1.1 nat while ((xpos < col + grid_x - 1) && (xpos <
143 1.1 nat x_limit)) {
144 1.1 nat mvaddch(line + grid_y - 1, xpos, 113 |
145 1.1 nat A_ALTCHARSET);
146 1.1 nat xpos++;
147 1.1 nat }
148 1.1 nat if (xpos < x_limit)
149 1.1 nat mvaddch(line + grid_y - 1, xpos, 110 |
150 1.1 nat A_ALTCHARSET);
151 1.1 nat }
152 1.1 nat ypos = line;
153 1.1 nat while (ypos < line + grid_y - 1) {
154 1.1 nat for (col = grid_x - 1; col < x_limit; col += grid_x) {
155 1.1 nat mvaddch(ypos, col + 1, 120 | A_ALTCHARSET);
156 1.1 nat }
157 1.1 nat ypos++;
158 1.1 nat }
159 1.1 nat }
160 1.1 nat
161 1.1 nat for (line = 1; line < y_limit; line += grid_y) {
162 1.1 nat mvaddch(line + grid_y - 1, 0, 116 | A_ALTCHARSET);
163 1.1 nat mvaddch(line + grid_y - 1, x_limit, 117 | A_ALTCHARSET);
164 1.1 nat
165 1.1 nat ypos = line;
166 1.1 nat while (ypos < line + grid_y - 1) {
167 1.1 nat mvaddch(ypos, 0, 120 | A_ALTCHARSET);
168 1.1 nat mvaddch(ypos, x_limit, 120 | A_ALTCHARSET);
169 1.1 nat ypos++;
170 1.1 nat }
171 1.1 nat }
172 1.1 nat
173 1.1 nat for (col = 1; col < x_limit; col += grid_x) {
174 1.1 nat mvaddch(0, col + grid_x - 1, 119 | A_ALTCHARSET);
175 1.1 nat mvaddch(y_limit, col + grid_x - 1, 118 | A_ALTCHARSET);
176 1.1 nat
177 1.1 nat xpos = col;
178 1.1 nat while ((xpos < col + grid_x - 1) && (xpos < x_limit)) {
179 1.1 nat mvaddch(0, xpos, 113 | A_ALTCHARSET);
180 1.1 nat mvaddch(y_limit, xpos, 113 | A_ALTCHARSET);
181 1.1 nat xpos++;
182 1.1 nat }
183 1.1 nat }
184 1.1 nat
185 1.1 nat mvaddch(0, 0, 108 | A_ALTCHARSET);
186 1.1 nat mvaddch(0, x_limit, 107 | A_ALTCHARSET);
187 1.1 nat mvaddch(y_limit, 0, 109 | A_ALTCHARSET);
188 1.1 nat mvaddch(y_limit, x_limit, 106 | A_ALTCHARSET);
189 1.1 nat
190 1.1 nat /* Draw a white circle. */
191 1.1 nat for (i = 1; i < y_limit; i++) {
192 1.1 nat for (col = circle_pos[i][0]; col <= circle_pos[i][1]; col++) {
193 1.1 nat mvaddch(i, col, 32 | A_REVERSE);
194 1.1 nat }
195 1.1 nat }
196 1.2 jmcneill
197 1.1 nat /* Add title segment. */
198 1.1 nat for (i = roundf(1 * grid_unit); i < roundf(2 * grid_unit); i++) {
199 1.1 nat if (colourOK)
200 1.1 nat attrset(COLOR_PAIR(COLOR_BLACK));
201 1.1 nat
202 1.1 nat for (col = roundf((4 * grid_unit * 2) +
203 1.1 nat circle_pos[y_limit /2][0]); col <= roundf((9 * grid_unit
204 1.1 nat * 2) + circle_pos[y_limit /2][0]); col++)
205 1.1 nat mvaddch(i, col, ' ');
206 1.1 nat }
207 1.1 nat
208 1.2 jmcneill i = roundf(1.4 * grid_unit);
209 1.1 nat
210 1.1 nat col = y_limit - (strlen(title) / 2) + circle_pos[y_limit / 2][0];
211 1.1 nat mvprintw(i, col, "%s", title);
212 1.1 nat
213 1.1 nat /* Add black segments at top. */
214 1.1 nat for (line = roundf(2 * grid_unit); line < 4 * grid_unit; line++) {
215 1.1 nat if (colourOK)
216 1.1 nat attrset(COLOR_PAIR(COLOR_BLACK));
217 1.1 nat
218 1.1 nat for (col = 0; col <= roundf((3.5 * grid_unit * 2)); col++) {
219 1.1 nat xpos = col + circle_pos[y_limit / 2][0];
220 1.1 nat if (xpos >= circle_pos[line][0] &&
221 1.1 nat xpos <= circle_pos[line][1])
222 1.1 nat mvaddch(line, xpos, ' ');
223 1.1 nat }
224 1.1 nat
225 1.2 jmcneill for (col = roundf((9.5 * grid_unit * 2)); col <
226 1.1 nat roundf((13 * grid_unit * 2)); col++) {
227 1.1 nat xpos = col + circle_pos[y_limit / 2][0];
228 1.1 nat if (xpos >= circle_pos[line][0] &&
229 1.1 nat xpos <= circle_pos[line][1])
230 1.1 nat mvaddch(line, xpos, ' ');
231 1.1 nat }
232 1.1 nat }
233 1.1 nat
234 1.1 nat /* Add black and white squares close to top. */
235 1.1 nat int gap = (circle_pos[(int)(5 * grid_unit)][1] -
236 1.1 nat circle_pos[(int)(5 * grid_unit)][0]) / 13;
237 1.1 nat
238 1.1 nat for (i = roundf(3 * grid_unit); i < roundf(4 * grid_unit); i++) {
239 1.1 nat for (xpos = 0; xpos <= x_limit; xpos += 2 * gap) {
240 1.1 nat if (colourOK)
241 1.1 nat attrset(COLOR_PAIR(COLOR_BLACK));
242 1.1 nat
243 1.1 nat for (col = xpos; col < xpos + gap; col++) {
244 1.1 nat if (col >= circle_pos[i][0] &&
245 1.1 nat col <= circle_pos[i][1])
246 1.1 nat mvaddch(i, col, ' ');
247 1.1 nat }
248 1.1 nat
249 1.1 nat if (colourOK)
250 1.1 nat attrset(COLOR_PAIR(COLOR_WHITE));
251 1.1 nat
252 1.1 nat for (col = xpos + gap ; col < xpos + (2 * gap);
253 1.1 nat col++) {
254 1.1 nat if (col >= circle_pos[i][0] &&
255 1.1 nat col <= circle_pos[i][1])
256 1.1 nat mvaddch(i, col, ' ');
257 1.1 nat }
258 1.1 nat }
259 1.1 nat }
260 1.1 nat
261 1.1 nat /* Add colour bars. */
262 1.1 nat for (i = 0; i < numcolours; i++) {
263 1.1 nat colour = colour_list[i];
264 1.1 nat if (colourOK)
265 1.1 nat attrset(COLOR_PAIR(colour));
266 1.1 nat
267 1.2 jmcneill if (i == 0)
268 1.1 nat spacing_start = 0;
269 1.1 nat else
270 1.1 nat spacing_start = (spacing * i) + spacing_residual;
271 1.1 nat
272 1.1 nat if (i == numcolours - 1)
273 1.1 nat spacing_end = circle_pos[y_limit / 2][1];
274 1.1 nat else
275 1.1 nat spacing_end = (spacing * (i + 1)) + spacing_residual;
276 1.1 nat
277 1.1 nat for (line = roundf(4 * grid_unit); line < (y_limit / 2);
278 1.1 nat line++) {
279 1.1 nat for (col = spacing_start; col < spacing_end; col++) {
280 1.1 nat xpos = col + circle_pos[y_limit / 2][0];
281 1.1 nat if (xpos >= circle_pos[line][0] &&
282 1.1 nat xpos <= circle_pos[line][1])
283 1.1 nat mvprintw(line, xpos, " ");
284 1.1 nat }
285 1.1 nat }
286 1.1 nat }
287 1.1 nat
288 1.1 nat /* Add black segment under centre line. */
289 1.1 nat for (line = y_limit / 2; line < (9.5 * grid_unit); line++) {
290 1.1 nat if (colourOK)
291 1.1 nat attrset(COLOR_PAIR(COLOR_BLACK));
292 1.1 nat
293 1.1 nat for (col = circle_pos[line][0]; col <= circle_pos[line][1];
294 1.1 nat col++)
295 1.1 nat mvaddch(line, col, ' ');
296 1.1 nat
297 1.2 jmcneill for (col = roundf((1.5 * grid_unit * 2)); col <
298 1.1 nat roundf((4.3 * grid_unit * 2)); col++) {
299 1.1 nat xpos = col + circle_pos[y_limit / 2][0];
300 1.1 nat if (xpos >= circle_pos[line][0] &&
301 1.1 nat xpos < circle_pos[line][1])
302 1.1 nat mvaddch(line, xpos, 120 | A_ALTCHARSET);
303 1.1 nat }
304 1.1 nat
305 1.2 jmcneill for (col = roundf((4.3 * grid_unit * 2)); col <
306 1.1 nat roundf((7.6 * grid_unit * 2)); col++) {
307 1.1 nat xpos = col + circle_pos[y_limit / 2][0];
308 1.1 nat if (xpos >= circle_pos[line][0] &&
309 1.1 nat xpos < circle_pos[line][1])
310 1.1 nat mvaddch(line, xpos, '|');
311 1.1 nat }
312 1.1 nat
313 1.2 jmcneill for (col = roundf((7.6 * grid_unit * 2)); col <
314 1.1 nat roundf((11.5 * grid_unit * 2)); col++) {
315 1.1 nat xpos = col + circle_pos[y_limit / 2][0];
316 1.1 nat if (xpos >= circle_pos[line][0] &&
317 1.1 nat xpos < circle_pos[line][1])
318 1.1 nat mvaddch(line, xpos, 97 | A_ALTCHARSET);
319 1.1 nat }
320 1.1 nat }
321 1.1 nat
322 1.1 nat /* Add black segment close to bottom. */
323 1.1 nat for (line = roundf(9.5 * grid_unit); line <= (10.5 * grid_unit);
324 1.1 nat line++) {
325 1.1 nat if (colourOK)
326 1.1 nat attrset(COLOR_PAIR(COLOR_BLACK));
327 1.1 nat
328 1.2 jmcneill for (col = roundf((0 * grid_unit * 2)); col <
329 1.1 nat roundf((4 * grid_unit * 2)); col++) {
330 1.1 nat xpos = col + circle_pos[y_limit / 2][0];
331 1.1 nat if (xpos >= circle_pos[line][0] &&
332 1.1 nat xpos < circle_pos[line][1])
333 1.1 nat mvaddch(line, xpos, ' ');
334 1.1 nat }
335 1.1 nat
336 1.2 jmcneill for (col = roundf((4 * grid_unit * 2)); col <
337 1.1 nat roundf((6.5 * grid_unit * 2)); col++) {
338 1.1 nat xpos = col + circle_pos[y_limit / 2][0];
339 1.1 nat if (xpos >= circle_pos[line][0] &&
340 1.1 nat xpos < circle_pos[line][1])
341 1.1 nat mvaddch(line, xpos, 97 | A_ALTCHARSET);
342 1.1 nat }
343 1.1 nat
344 1.1 nat if (colourOK)
345 1.1 nat attrset(COLOR_PAIR(COLOR_WHITE));
346 1.1 nat
347 1.2 jmcneill for (col = roundf((6.5 * grid_unit * 2)); col <
348 1.1 nat roundf((9 * grid_unit * 2)); col++) {
349 1.1 nat xpos = col + circle_pos[y_limit / 2][0];
350 1.1 nat if (xpos >= circle_pos[line][0] &&
351 1.1 nat xpos < circle_pos[line][1])
352 1.1 nat mvaddch(line, xpos, 97 | A_ALTCHARSET);
353 1.1 nat }
354 1.1 nat
355 1.2 jmcneill for (col = roundf((9 * grid_unit * 2)); col <
356 1.1 nat roundf((13 * grid_unit * 2)); col++) {
357 1.1 nat xpos = col + circle_pos[y_limit / 2][0];
358 1.1 nat if (xpos >= circle_pos[line][0] &&
359 1.1 nat xpos < circle_pos[line][1])
360 1.1 nat mvaddch(line, xpos, ' ');
361 1.1 nat }
362 1.1 nat }
363 1.1 nat
364 1.1 nat /* Add name segment close to bottom. */
365 1.1 nat for (line = roundf(10.5 * grid_unit); line < (12 * grid_unit);
366 1.1 nat line++) {
367 1.1 nat if (colourOK)
368 1.1 nat attrset(COLOR_PAIR(COLOR_BLACK));
369 1.1 nat
370 1.1 nat for (col = roundf(3.5 * grid_unit * 2); col <= roundf(9.5 *
371 1.1 nat grid_unit * 2); col++) {
372 1.1 nat xpos = col + circle_pos[y_limit / 2][0];
373 1.1 nat if (xpos >= circle_pos[line][0] &&
374 1.1 nat xpos < circle_pos[line][1])
375 1.1 nat mvaddch(line, xpos, ' ');
376 1.1 nat }
377 1.1 nat
378 1.1 nat if (colourOK)
379 1.1 nat attrset(COLOR_PAIR(COLOR_WHITE));
380 1.1 nat
381 1.1 nat for (col = roundf(0 * grid_unit * 2); col <= roundf(3.5 *
382 1.1 nat grid_unit * 2); col++) {
383 1.1 nat xpos = col + circle_pos[y_limit / 2][0];
384 1.1 nat if (xpos >= circle_pos[line][0] &&
385 1.1 nat xpos < circle_pos[line][1])
386 1.1 nat mvaddch(line, xpos, ' ');
387 1.1 nat }
388 1.1 nat
389 1.1 nat for (col = roundf(9.5 * grid_unit * 2); col <= roundf(13 *
390 1.1 nat grid_unit * 2); col++) {
391 1.1 nat xpos = col + circle_pos[y_limit / 2][0];
392 1.1 nat if (xpos >= circle_pos[line][0] &&
393 1.1 nat xpos < circle_pos[line][1])
394 1.1 nat mvaddch(line, xpos, ' ');
395 1.1 nat }
396 1.1 nat }
397 1.1 nat
398 1.1 nat /* Add yellow segment at bottom. */
399 1.1 nat for (line = 12 * grid_unit; line < y_limit; line++) {
400 1.1 nat if (colourOK)
401 1.1 nat attrset(COLOR_PAIR(COLOR_YELLOW));
402 1.1 nat
403 1.1 nat for (col = circle_pos[line][0]; col <= circle_pos[line][1];
404 1.1 nat col++)
405 1.1 nat mvaddch(line, col, ' ');
406 1.1 nat
407 1.1 nat if (colourOK)
408 1.1 nat attrset(COLOR_PAIR(COLOR_RED));
409 1.1 nat
410 1.2 jmcneill for (col = roundf((6 * grid_unit * 2)); col <
411 1.1 nat roundf((7 * grid_unit * 2)); col++) {
412 1.1 nat xpos = col + circle_pos[y_limit / 2][0];
413 1.1 nat if (xpos >= circle_pos[line][0] &&
414 1.1 nat xpos < circle_pos[line][1])
415 1.1 nat mvaddch(line, xpos, ' ');
416 1.1 nat }
417 1.1 nat }
418 1.1 nat
419 1.1 nat if (colourOK)
420 1.1 nat attrset(COLOR_PAIR(COLOR_BLACK));
421 1.2 jmcneill
422 1.1 nat for (line = 6 * grid_unit; line <= (7 * grid_unit) + 1; line++) {
423 1.1 nat if (colourOK)
424 1.1 nat attrset(COLOR_PAIR(COLOR_BLACK));
425 1.1 nat
426 1.1 nat col = x_limit / 2;
427 1.1 nat if (line != a_axis) {
428 1.1 nat mvaddch(line, col - 1, ' ');
429 1.1 nat mvaddch(line, col, 120 | A_ALTCHARSET);
430 1.1 nat mvaddch(line, col + 1, ' ');
431 1.1 nat }
432 1.1 nat }
433 1.1 nat
434 1.1 nat line = y_limit / 2;
435 1.1 nat for (col = 1; col < x_limit; col = col + grid_x) {
436 1.1 nat xpos = col;
437 1.1 nat while (xpos < col + grid_x - 1) {
438 1.1 nat if (xpos >= circle_pos[line][0] && xpos < circle_pos[line][1])
439 1.1 nat mvaddch(line, xpos, 113 | A_ALTCHARSET);
440 1.1 nat xpos++;
441 1.1 nat }
442 1.1 nat if (xpos >= circle_pos[line][0] && xpos < circle_pos[line][1])
443 1.1 nat mvaddch(line, xpos, 110 | A_ALTCHARSET);
444 1.1 nat }
445 1.1 nat
446 1.1 nat line = y_limit / 2;
447 1.1 nat col = x_limit / 2;
448 1.1 nat mvaddch(line, col, 110 | A_ALTCHARSET);
449 1.1 nat mvaddch(line, col - 1, 113 | A_ALTCHARSET);
450 1.1 nat mvaddch(line, col + 1, 113 | A_ALTCHARSET);
451 1.1 nat
452 1.1 nat refresh();
453 1.1 nat
454 1.1 nat getch();
455 1.1 nat
456 1.1 nat endwin();
457 1.1 nat
458 1.1 nat return EXIT_SUCCESS;
459 1.1 nat }
460 1.1 nat
461