-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
splited files with specific functions;;file managing, text editing left
- Loading branch information
Showing
7 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <stdio.h> | ||
#include <Windows.h> | ||
|
||
void gotoxy(int x, int y) //커서 위치 옮기기 | ||
{ //좌상단은 (0,0)이지만 (1,1)로 사용함 | ||
COORD Cur; | ||
Cur.X = x; Cur.Y = y; | ||
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), Cur); | ||
} | ||
|
||
int now_x() //현재 x커서 위치 | ||
{ //좌상단이 (1,1)로 바뀌었을때의 정보를출력함 | ||
CONSOLE_SCREEN_BUFFER_INFO BufInfo; | ||
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &BufInfo); | ||
return BufInfo.dwCursorPosition.X; | ||
} | ||
|
||
int now_y() // 현재 y커서 위치 | ||
{ | ||
CONSOLE_SCREEN_BUFFER_INFO BufInfo; | ||
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &BufInfo); | ||
return BufInfo.dwCursorPosition.Y; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef CURSOR_H | ||
#define CURSOR_H | ||
|
||
#include <Windows.h> | ||
|
||
//functions | ||
void gotoxy(int x, int y); | ||
int now_x(); | ||
int now_y(); | ||
|
||
#endif // !CURSOR_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <Windows.h> | ||
|
||
int dye(int n, int f_color, int b_color, char* ch) // 이전 색 뭐였는지 유의!! | ||
{ //n=0이면 문자, 문자열 출력 n>0이면 그만큼 반복 출력 | ||
int i = 0; | ||
int color = f_color + b_color * 16; | ||
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color); | ||
if (n > 0) | ||
{ | ||
for (i = 0; i < n; i++) | ||
{ | ||
printf("%c", ch); | ||
} | ||
return 0; | ||
} | ||
else if ((n == 0) && (sizeof(ch) == sizeof(char))) | ||
{ | ||
printf("%c", ch); | ||
return 0; | ||
} | ||
else if ((n == 0) && (sizeof(ch) != sizeof(char))) | ||
{ | ||
printf("%s", ch); | ||
return 0; | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#ifndef INTERFACES_H | ||
#define INTERFACES_H | ||
|
||
#include <stdio.h> | ||
#include <Windows.h> | ||
|
||
#ifdef COLORS | ||
|
||
//default colors | ||
#define BLACK 0 | ||
#define BLUE 1 | ||
#define GREEN 2 | ||
#define CYAN 3 | ||
#define RED 4 | ||
#define MAGENTA 5 | ||
#define BROWN 6 | ||
#define LIGHTGRAY 7 | ||
#define DARKGRAY 8 | ||
#define LIGHTBLUE 9 | ||
#define LIGHTGREEN 10 | ||
#define LIGHTCYAN 11 | ||
#define LIGHTRED 12 | ||
#define LIGHTMAGENTA 13 | ||
#define YELLOW 14 | ||
#define WHITE 15 | ||
|
||
#endif // !COLORS | ||
|
||
|
||
//functions | ||
int dye(int n, int f_color, int b_color, char* ch); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
#endif // !INTERFACES_H |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef INTERRUPTS_H | ||
#define INTERRUPTS_H | ||
|
||
#include <Windows.h> | ||
|
||
|
||
|
||
|
||
#endif // !INTERRUPTS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters