[컴퓨터] C를 이용한 가위바위보
- 최초 등록일
- 2003.09.22
- 최종 저작일
- 2003.09
- 6페이지/
한컴오피스
- 가격 3,000원
![할인쿠폰받기](/images/v4/document/ico_det_coupon.gif)
목차
※C로 프로그래밍한 가위바위보 게임.
본문내용
int main(void)
{
int win_cnt = 0, lose_cnt = 0, tie_cnt = 0;
outcome result;
p_r_s player_choice, machine_choice;
srand(time(NULL)); /* seed the random number generator */
prn_instructions();
while ((player_choice = selection_by_player()) != quit)
switch (player_choice) {
case paper :
case rock :
case scissors :
machine_choice = selection_by_machine();
result = compare(player_choice, machine_choice);
report_tabulate(result, &win_cnt, &lose_cnt, &tie_cnt);
break;
case game :
prn_game_status(win_cnt, lose_cnt, tie_cnt);
break;
case instructions :
참고 자료
없음