/*
#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>
void gotoxy(int x,int y)
{
COORD pos= {x,y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
int main()
{
char input,p,words[5][10]= {"hello","fineapple","mango","banana","melon"};
char answer[10]= {0};
srand(time(NULL));
int randomNumber;
int c=20,k,i;
srand(time(NULL));
gotoxy(42,5);
printf("--------------------------------");
gotoxy(53,6);
printf("HANG MAN");
gotoxy(55,8);
printf ("GAME");
gotoxy(53,10);
printf ("--Start--");
gotoxy(42,9);
printf("--------------------------------");
gotoxy(42,13);
printf("! 시작한다.");
for(;;)
{
if(kbhit())
{
input = getch();
if(input=='K'||input=='k')
{
system("cls");
gotoxy(47,12);
printf ("Loading...");
gotoxy(48,14);
printf ("Please Wait...");
Sleep(3000);
system("cls");
}
}
}
gotoxy(47,13);
printf ("알파벳을 입력해주세요");
randomNumber=rand()%strlen(words);
for(;;)
{
system ("cls");
for(i=0; i<strlen(words[randomNumber]); i++)
{
gotoxy(50+i,14);
if(answer[i]==0)
{
printf ("_");
}
else
{
printf ("%c",words[randomNumber][i]);
}
}
gotoxy(50,15);
scanf (" %c",&p);
for(i=0; i<strlen(words[randomNumber]); i++)
{
if(p==words[randomNumber][i])
{
answer[i]=1;
}
}
}
}
*/
/*
#include<stdio.h>
#include<string.h>
#include<windows.h>
#include<math.h>
#include<time.h>
void gotoxy(int x,int y)
{
COORD pos= {x,y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
int main()
{
char input,p, words[5][10] = {"hello", "fineapple", "mango", "banana", "melon"};
char answer[10] = {0};
srand(time(NULL));
int randomNumber;
int c=20,k,i;
srand(time(NULL));
gotoxy(44,1);
printf("---------------------");
gotoxy(48,2);
printf("HANG MAN GAME");
gotoxy(44,3);
printf("---------------------");
gotoxy(47,7);
printf("PRESS 'E' or 'e'");
for(;;)
{
if(kbhit())
{
input = getch();
if(input=='E'||input=='e')
{
system("cls");
gotoxy(50,13);
printf("LET'S START!");
Sleep(1000);
system("cls");
break;
}
}
}
gotoxy(50,13);
printf("알파벳을 입력해주세요");
randomNumber = rand()%strlen(words);
for(;;)
{
system("cls");
for(i=0; i<strlen(words[randomNumber]); i++)
{
gotoxy(50+i,14);
if(answer[i]==0)
{
printf("_");
}
else
{
printf("%c", words[randomNumber][i]);
}
}
gotoxy(50, 15);
scanf(" %c", &p);
for(i=0; i<strlen(words[randomNumber]); i++)
{
if(p==words[randomNumber][i])
{
answer[i] = 1;
}
}
/*
gotoxy(57,13);
scanf("%c",&p);
gotoxy(57,13);
printf(" ");
*/
}
}
/*