27 lines
395 B
C
27 lines
395 B
C
/*
|
|
* conio.h
|
|
*
|
|
* Created on: 06/mag/2017
|
|
* Author: topicchi
|
|
*/
|
|
#include <stdio.h>
|
|
|
|
#ifndef CONIO_H_
|
|
#define CONIO_H_
|
|
|
|
|
|
void gotoxy(int x, int y) {
|
|
printf("%c[%d;%df",0x1B, y, x);
|
|
}
|
|
|
|
void clrscr(void) {
|
|
fprintf(stdout, "\033[2J\033[0;0f");
|
|
fflush(stdout);
|
|
}
|
|
|
|
void textcolor(int attr, int fg, int bg) {
|
|
printf("%c[%d;%d;%dm", 0x1B, attr, fg + 30, bg + 40);
|
|
}
|
|
|
|
#endif /* CONIO_H_ */
|