U E D R , A S I H C RSS

새싹교실/2012/새싹교실강사교육/2주차

2

2 : Second Impact!
-과 , , GCC법, , main, 변, Data Type, , 력 기본 , 문 -
돼! (다 강 다)
1. Ice Breaking Wiki 기.
2. 과, 보기, 그리고 보기. 강보기.는 과목과.
3. 결과
4. 모르는 API 문법 보게 http://winapi.co.kr -> 관련 2 딩 Q&A
5. Wiki 보기

1. 게
http://wiki.zeropage.org/wiki.php//2011/무/벨4
게 복 + 붙!
///라 때리기 게!!
#include<stdio.h>
#include<math.h> //Rand를 가
#include<stdlib.h> 
#include<time.h>
#define KICK 350
#define PUNCH 200
#define SORAKICK 900
#define SORAPUNCH 1000
int main(){
	//력 , 내 기.
	int Sora = 2500, My = 5000; 
	int temp; // 
	char select; // 
	srand(time(NULL)); //Rand 드값 변경.
	printf("라때리기 게 다.\n");
	printf(" : 06 김 11 강   Target : 11 라\n");
	while(1){
		printf("력 : %d\n",Sora);
		printf("내 력 : %d\n",My);
		printf("발로기 : k 먹 : p\n");
		//공격 력
		select = getch(); //getch()는 char .
		switch(select){
			default: printf("못된 다\n"); break;
			case 'k' : 
				temp = ( ( rand() % KICK +1)); //1~KICK까 데미다.
				printf("라를 발로다. 데미 : %d 를 다!\n",temp);
				Sora = Sora - temp;  break;
			case 'p' :
				temp = ( ( rand() % PUNCH +1));
				printf("라를 때립다. 데미 : %d 를 다!\n",temp);
				
				Sora = Sora - temp; break;
		} //내공격 
		select = rand() %2 +1;// 랜덤.
		switch(select){
			case 1 : 
				temp = ( ( rand() % SORAKICK +1));
				printf("라가 발로다. 데미 : %d 를 다!\n",temp);
				My = My - temp;  break;
			case 2 : 
				temp = ( ( rand() % SORAPUNCH + 1));
				printf("라가 때립다. 데미 : %d 를 다!\n",temp);
				My = My - temp; break;
		}// 랜덤 공격
		//공격
		//	그리고 반복
	
		if(Sora <= 0 && My <= 0){
			printf("Double KO. 둘다 다.\n");
			break;
		}
		else if(Sora <= 0){
			printf("라를 다!!! \\(* ^ * )/ \n");
			break;
		}
		else if(My <= 0 ){
			printf("다.. OTL \n");
			break;//while문다.
		}
		//나?    
	}
	printf("\nGame Over\n");
	return 0;
	}
※ 강 가르는게 ? 다.

2. 딩 Q&A(모른다면 가르고, 배 다면 ! 공 라고 는 것 다)
2.1


2.2 #include<stdio.h>, printf(), scanf(); .


2.3 int, char, 변.


2.4 #define 문, 매


2.5 #include<math.h>, #include<stdlib.h>, #include<time.h>
srand(time(NULL)), rand(). 브러리.


2.6 If문, switch() { case : default : } 문.

3. 과
ACM 보겠다. 강 량과 *^_^* 뿌~!

것부 래로


디 : zeldababo : rlawns

다~! 보고 !

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:29:45
Processing time 0.0427 sec