#include <stdlib.h>
#include <time.h>
#include <conio.h>
#include <Windows.h>
//---------------------------------------------------------------------------------------------------
HANDLE consoleHandle;
enum eColor : int
{
clBlack,
clBlue,
clGreen,
clCyan,
clRed,
clPurple,
clYellow,
clWhite,
clBright,
};
void initVideo()
{
CONSOLE_CURSOR_INFO info;
info.bVisible = false;
info.dwSize = 1;
consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorInfo(consoleHandle, &info);
}
void gotoxy(int x, int y)
{
COORD p;
p.X = x;
p.Y = y;
SetConsoleCursorPosition(consoleHandle, p);
}
void putTile(int x, int y, int color)
{
gotoxy(x * 2, y);
SetConsoleTextAttribute(consoleHandle, (color != 0) * ((clBright | color) << 4));
putchar(' ');
putchar(' ');
}
void putString(int x, int y, int color, const char* s)
{
gotoxy(x, y);
SetConsoleTextAttribute(consoleHandle, clBright | color);
puts(s);
}
void putStringValue(int x, int y, int colorS, int colorV, const char* s, int value)
{
gotoxy(x, y);
SetConsoleTextAttribute(consoleHandle, clBright | colorS);
printf(s);
SetConsoleTextAttribute(consoleHandle, clBright | colorV);
printf("%d", value);
}
내가 얼마전에 점심시간에 테트리스 짜서 갤에 올릴때 작성한 콘솔 입출력 위치/색상 제어 코드들인데 갖다 써서 잼난거 만들어 봐라.
이형 요즘 프갤 왜캐 많이함
쟤 열심히 공부하잖아. ㅋㄷㅋㄷ
진도 빼는거 보면 귀엽지 않음?
gotoxy는 인자 순서가 y, x라는 거~
뭐 int x, int y 라고 쓰는 게 함수 쓰는 입장에서는 매우 편한데 나도 gotoxy 함수 만든 사람이 인자 순서를 왜 y, x 순으로 병신같이 해 놨는지 노 이해임. 아마 row, col 개념으로 쓴 것 같은데 그러면 함수 이름이 왜 gotoxy ㅋㅋ
난 옛날에도 BGI 같은거 안쓰고 다 인라인어셈 떡질해서 만들어 썼으니깐 ㅋㄷㅋㄷ 내 맘이야.
이제 봤네 잠좀 자고왓어 ㅋㅋㅋㅋ 파곤해서
http://autogram.tk/이
중고차 어플리케이션 어떤가요?