-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgm_checkwin.c
31 lines (28 loc) · 1.1 KB
/
gm_checkwin.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* gm_checkwin.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lchenut <lchenut@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/03/01 18:57:26 by lchenut #+# #+# */
/* Updated: 2015/03/01 18:59:48 by lchenut ### ########.fr */
/* */
/* ************************************************************************** */
#include "game.h"
int gm_checkwin(int **tab, int size, int test)
{
int x;
int y;
if (test)
return (0);
y = -1;
while (++y < size)
{
x = 0;
while (x < size)
if (tab[y][x++] >= WIN_VALUE)
return (1);
}
return (0);
}