/*#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello world!\n");
return 0;
*/
/*
#include<stdio.h>
#include<string.h>
#include<windows.h>
#include<math.h>
#include<time.h>
#define LEFT 75
#define RIGHT 77
#define UP 72
#define DOWN 80
void gotoxy(int x,int y)
{
COORD pos= {x,y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
int main()
{
int x,y,n,k,value,c=0,a;
char input;
srand(time(NULL));
gotoxy(42,5);
printf("--------------------------------");
gotoxy(53,6);
printf("Up and Down");
gotoxy(55,8);
printf ("GAME");
gotoxy(53,10);
printf ("--Start--");
gotoxy(42,9);
printf("--------------------------------");
gotoxy(47,12);
printf ("PRESS 'k'");
gotoxy(42,15);
printf("! 시작한다.");
gotoxy(42,17);
printf ("! 시작하지 않는다.");
for(;;)
{
Sleep(1);
if(kbhit())
{
input = getch();
if(k==0)
{
if(input=='K' || input=='k')
{
system ("cls");
gotoxy (51,13);
printf ("Loading...");
gotoxy (51,15);
printf ("Please wait...");
Sleep (3000);
syste ("cls");
break;
}
}
else
{
if(input=='K' || input=='k')
{
system ("cls");
gotoxy (50,13);
printf ("The game is over");
Sleep (2000);
system ("cls");
break;
}
}
if(input== UP)
{
if(k==1)
{
k=0;
}
}
else if(input== DOWN)
{
if(k==0)
{
k=1;
}
}
if(k==0)
{
gotoxy(47,15);
printf (" ");
}
}
value = rand()%100+1;
gotoxy(47,13);
printf ("1~100까지의 숫자를 입력해주세요.");
for(;;)
{
scanf ("%d", &a);
}
}
*/
/*
#include<stdio.h>
#include<string.h>
#include<windows.h>
#include<math.h>
#include<time.h>
#define LEFT 75
#define RIGHT 77
#define UP 72
#define DOWN 80
void gotoxy(int x,int y)
{
COORD pos= {x,y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
void setColor(int x)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), x);
}
int map[25][25] = {0};
int dx, dy;
int pX, pY;
int fX, fY;
int main()
{
char input;
srand(time(NULL));
setColor(7);
dx = 1;
dy = 0;
pX = 5;
pY = 5;
fX = rand()%20+2;
fY = rand()%20+2;
map[fX][fY] = 1;
gotoxy(fX, fY);
printf("@");
for(;;)
{
Sleep(100);
gotoxy(pX, pY);
printf(" ");
pX += dx;
pY += dy;
gotoxy(pX, pY);
printf("-");
if(kbhit())
{
input = getch();
switch(input)
{
case DOWN:
dy = 1;
dx = 0;
break;
case UP:
dy = -1;
dx = 0;
break;
}
}
}
}
*/