File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,42 @@ extern void restoreConsole(void);
1111
1212Win winVerifyer (int grid [6 ][7 ])
1313{
14+ Win returnValue ;
15+ for (int i = 0 ; i < 6 ; i ++ )
16+ {
17+ for (int j = 0 ; j < 3 ; j ++ )
18+ {
19+ if (grid [i ][j ] == 1 && grid [i ][j + 1 ] == 1 && grid [i ][j + 2 ] == 1 && grid [i ][j + 3 ] == 1 )
20+ {
21+ returnValue .win = true;
22+ returnValue .victoryType = 'H' ;
23+ returnValue .row = i ;
24+ returnValue .row = j ;
25+ }
26+
27+ if (grid [i ][j ] == -1 && grid [i ][j + 1 ] == -1 && grid [i ][j + 2 ] == -1 && grid [i ][j + 3 ] == -1 )
28+ {
29+ returnValue .win = true;
30+ returnValue .victoryType = 'H' ;
31+ returnValue .row = i ;
32+ returnValue .row = j ;
33+ }
34+ }
1435
36+ for (int j = 0 ; j < 7 ; j ++ )
37+ {
38+ for (int i = 0 ; i < 2 ; i ++ )
39+ {
40+ if (grid [i ][j ] == 1 && grid [i + 1 ][j ] == 1 && grid [i + 2 ][j ] == 1 && grid [i + 3 ][j ] == 1 )
41+ {
42+ returnValue .win = true;
43+ returnValue .victoryType = 'V' ;
44+ returnValue .row = i ;
45+ returnValue .row = j ;
46+ }
47+ }
48+ }
49+ }
1550}
1651
1752void supergridGenerator (char supergrid [37 ][98 ])
You can’t perform that action at this time.
0 commit comments