-
Notifications
You must be signed in to change notification settings - Fork 0
/
matinput.c
69 lines (61 loc) · 1.17 KB
/
matinput.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
60
61
62
63
64
65
66
67
68
69
#include <stdio.h>
#include <stdlib.h>
void saisir(char m[5][5], int n){
int i=-1,x,y;
do {
i++;
do {
printf("cout N %d\n",i);
scanf("%d %d",&x,&y);
if(x==1&&y==1) {
x=0;
y=0;
};
if(x==1&&y==2){
x=0;
y=2;
};
if(x==1&&y==3){
x=0;
y=4;
};
if(x==2&&y==1){
x=2;
y=0;
};
if(x==2&&y==2){
x=2;
y=2;
};
if(x==2&&y==3){
x=2;
y=4;
};
if(x==3&&y==1){
x=4;
y=0;
};
if(x==3&&y==2){
x=4;
y=2;
};
if(x==3&&y==3){
x=4;
y=4;
}}while(m[x][y]!=' ');
if(!(i%2))
m[x][y]='x';
else
m[x][y]='o';
printf("\n");
system("cls");
afficher(m,5);
}while(!veriftotale(m)&& i<8);
if(veriftotale(m))
if(!(i%2))
printf("Felicitations X, you have won");
else
printf("Felicitations O, you have won");
else
printf("THE MATCH IS DRAW, try another time.\n");
}