MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / diagonalWinCheck

Function diagonalWinCheck

assets/js/Match_Four_Game.js:70–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68
69//Diagonal Wins
70function diagonalWinCheck() {
71 for (var col = 0; col < 5; col++) {
72 for (var row = 0; row < 7; row++) {
73 if (colorMatchCheck(returnColor(row,col), returnColor(row+1,col+1) ,returnColor(row+2,col+2), returnColor(row+3,col+3))) {
74 reportWin(row,col);
75 return true;
76 }else if (colorMatchCheck(returnColor(row,col), returnColor(row-1,col+1) ,returnColor(row-2,col+2), returnColor(row-3,col+3))) {
77 reportWin(row,col);
78 return true;
79 }else {
80 continue;
81 }
82 }
83 }
84}
85
86//End
87function gameEnd(winningPlayer) {

Callers 1

Match_Four_Game.jsFile · 0.85

Calls 3

colorMatchCheckFunction · 0.85
returnColorFunction · 0.85
reportWinFunction · 0.85

Tested by

no test coverage detected