2019-10-30 15:31:38 +11:00
|
|
|
/*
|
|
|
|
* NcLooper--- interface curses, fonctions de base
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2019-11-04 04:58:21 +11:00
|
|
|
#include "ncfuncs.h"
|
2019-10-30 15:31:38 +11:00
|
|
|
|
|
|
|
/* --------------------------------------------------------------------- */
|
2019-12-24 03:55:31 +11:00
|
|
|
int init_ecran(const char *txt)
|
2019-10-30 15:31:38 +11:00
|
|
|
{
|
|
|
|
initscr();
|
|
|
|
|
|
|
|
standout();
|
2019-11-04 04:58:21 +11:00
|
|
|
// border('o', 'o', 'o', 'o', 'X', 'X', 'X', 'X');
|
2019-10-30 15:31:38 +11:00
|
|
|
standend();
|
|
|
|
mvaddstr(1, 5, txt);
|
|
|
|
refresh();
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
/* --------------------------------------------------------------------- */
|
|
|
|
int fin_ecran(void)
|
|
|
|
{
|
|
|
|
|
|
|
|
endwin();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* --------------------------------------------------------------------- */
|
2019-11-04 04:58:21 +11:00
|
|
|
int idx2position(int idx, int *prow, int *pcol)
|
|
|
|
{
|
|
|
|
|
|
|
|
*prow = 6 + (idx % 13);
|
|
|
|
*pcol = 4 + (40*(idx/13));
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* --------------------------------------------------------------------- */
|