Introduced range and offset in sorter movement.
[funnysort.git] / congl.c
blob99d83a252fcd0a1e9c3a49921baa248582c6ce13
1 #include "congl.h"
3 #include <stdio.h>
5 void conglMoveCursorUp (int ammount)
7 printf("\e[%dA",ammount);
8 fflush(stdout);
11 void conglMoveCursorDown (int ammount)
13 printf("\e[%dB",ammount);
14 fflush(stdout);
17 void conglMoveCursorRight (int ammount)
19 printf("\e[%dC",ammount);
20 fflush(stdout);
23 void conglMoveCursorLeft (int ammount)
25 printf("\e[%dD",ammount);
26 fflush(stdout);
29 void conglMoveCursor(int line, int column)
31 printf("\e[%d;%dH",line, column);
32 fflush(stdout);
35 void conglClearScreen(void)
37 printf("\e[2J");
38 fflush(stdout);
41 void conglSetBg(conglColor_t color)
43 printf("\e[4%dm", color);
44 fflush(stdout);
47 void conglSetFg(conglColor_t color)
49 printf("\e[3%dm", color);
50 fflush(stdout);
53 void conglReset(void)
55 printf("\e[m");
56 fflush(stdout);
59 void conglDrawChar(char ch)
61 printf("%c",ch);
62 fflush(stdout);
65 void conglDrawCharFull(int line, int column, char ch, conglColor_t fg, conglColor_t bg)
67 conglSetFg(fg);
68 conglSetBg(bg);
69 conglMoveCursor(line, column);
70 conglDrawChar(ch);
71 conglMoveCursor(line, column);