U E D R , A S I H C RSS

새싹교실/2012/아우토반/앞반/4.12



1.


O
O
O

2.

  • rand, srand
  • time(NULL)


3.


1. 기 게 .
:
1) 0
2)
3) 공격 : ,
4)
-
: 1000
: 500
- 공격
: 50~100
: 80~100
: 50~150

2. .



4.

  • : F4(ThreeFs + Future Action Plan) .
    • : ThreeFs, ThreeFs(), FiveFs()

      • Facts, Feelings, Findings, Future Action Plan. , , , 깨 , .
      • : " 5 .() 기 .() .(깨) .()"



5.






#include<stdio.h>
#include<time.h>
#include<math.h>
#include<stdlib.h>



void main(){
int Sundae = 1000;
int Player = 500;


int sundaeattack;
int userkick;
int userpunch;
int user_attack_type;

	printf(" 기 게 start!\n");
	printf("  : %d\n",Sundae);
	printf("  : %d\n",Player);

	printf(" 공\n");

	srand((unsigned)time(NULL));

	while(Sundae>=1){
			sundaeattack = rand()%101+50;
			Player - sundaeattack;
			printf("Player %d  .\n",sundaeattack);
			printf("User 공격  : Punch = p , Kick = k : \n");
			scanf("%c",&user_attack_type);

		for(Player;Player<=0;)
			{
			if(user_attack_type == 'p'){
				userpunch = rand()%101+80;
				Sundae - userpunch;
				printf("User %d  .\n",userpunch);

			}
			if(user_attack_type == 'k'){
				userkick = rand()%151+50;
				Sundae - userkick;
				printf("User %d  .\n",userkick);
			}
			continue;

		}
			
	
	
	
	
	if(Sundae <= 0 && Player <= 0){
		printf(" 금ㅠ\n");
		break;
	}
	else if(Sundae <= 0){
		printf(" E겼 !!EE!!\n");
		break;
	}
	else if(Player <= 0){
		printf("금ㅠ\n");
		break;
	}
	}
	printf("게 !..\n");

	system("pause"); 
}

 for ....  ... ...
continue  과 switch case 'p'       .
  ㅠㅠ

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