+/*
+** dungeon1
+**
+** 2021-12, markus schnalke <meillo@marmaro.de>
+*/
+
+#include "main.h"
+
+int
+main(void)
+{
+ int x, y;
+ WINDOW *win;
+ int c;
+ enum {
+ W = 80,
+ H = 24,
+ };
+ char c2;
+
+ win = initscr();
+ noecho();
+ cbreak();
+ keypad(stdscr, TRUE);
+/*
+ nonl();
+ intrflush(stdscr, FALSE);
+*/
+
+ mvprintw(0, 20, "%d:%d", W, H);
+ move(H/2, W/2);
+ refresh();
+
+ while ((c = getch()) != ERR) {
+ if (c == 'q') {
+ break;
+ }
+ getyx(win, y, x);
+ addch('.');
+ switch (c) {
+ case KEY_LEFT:
+ case 'h':
+ if (x > 0) {
+ x--;
+ }
+ break;
+ case KEY_RIGHT:
+ case 'l':
+ if (x < W) {
+ x++;
+ }
+ break;
+ case KEY_UP:
+ case 'k':
+ if (y > 1) {
+ y--;
+ }
+ break;
+ case KEY_DOWN:
+ case 'j':
+ if (y < H) {
+ y++;
+ }
+ break;
+ }
+ c2 = mvinch(y, x) & 255;
+ switch (c2) {
+ }
+ mvprintw(0, 40, "<%c>", c2);
+ mvprintw(0, 0, "%d:%d", x, y);
+ move(y, x);
+
+ refresh();
+ napms(10);
+ }
+
+ endwin();
+ return 0;
+}
+