-
Notifications
You must be signed in to change notification settings - Fork 0
/
11.19.c
59 lines (48 loc) · 1022 Bytes
/
11.19.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "comp2.h"
int main()
{
int x, y;
int check = 0;
int pop_size = 1;
int bit_count = 2;
int data_count = 2;
population *pop = create_population(pop_size, bit_count, data_count);
while(1)
{
printf("x : ");
scanf("%d", &x);
printf("y : ");
scanf("%d", &y);
if(x<0 || x>14)// 오목판을 넘어가는 숫자를 입력시 다시 입력
{
check = 1;
}
else if(y<0 || y>14)
{
check = 1;
}
if(check == 1)
{
printf("다시 입력 하세요\n");
check = 0;
continue;
}
if(board[x][y] == 1)// 중복을막음
{
printf("중복된 곳입니다.\n");
continue;
}
board[x][y] = 1;
rand_population(pop);//랜덤수 추출
for(int i = 0; i < pop->pop_size; i++){
printf("컴퓨터의 출력\n");
for(int j = 0; j < bit_count; j++){
printf("%d ", pop->ivd[i].crms[j]);//랜덤한 좌표출력
}
printf("\n");
}
}
free_population(pop);
printf("아무키나 누르십시오...");getchar();
return 0;
}