annotate minibasediolib.h @ 7:1bb981516d87

Automated Vimcurial commmit
author VilyaemKenyaz
date Sat, 09 Sep 2023 17:11:20 -0400
parents 0ed615367b10
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
1 //BasedIOLib without *nix conio implementation
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
2
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
3 //Clear the screen like in the Temple!
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
4 void DocClear(){
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
5
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
6 puts("\x1b[H\x1b[J");
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
7
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
8 }
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
9
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
10
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
11 //Mova the cursor to the top of the screen like in the temple!
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
12 void DocTop(){
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
13
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
14 puts("\033[2J");
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
15
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
16 }
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
17
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
18 //Move the cursor to this line and column
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
19 void SetCursor(int line, int column){
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
20
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
21 printf("\033[<%d>;<%d>f",line,column);
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
22
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
23 }
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
24
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
25 //Print the rest of a string given an indice
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
26 void PutRest(char* ptr, int index){
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
27
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
28 ptr += index;
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
29
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
30 puts(ptr);
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
31
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
32 }
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
33
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
34
0ed615367b10 Automated Vimcurial commmit
VilyaemKenyaz
parents:
diff changeset
35