here is my block code for my Prizm connect-four game:
Code: if((board[0][0] == 0) && (Player == 2)) {
board[0][0] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 8, 181, 34, 34);
Bdisp_PutDisp_DD();
board[0][0] = 2;
Winner = 0;
Player = 1;
}
else {
board[0][0] = 0;
Winner = 0;
}
}
else if((board[1][0] == 0) && (Player == 2)) {
board[1][0] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 8, 145, 34, 34);
Bdisp_PutDisp_DD();
board[1][0] = 2;
Winner = 0;
Player = 1;
}
else {
board[1][0] = 0;
Winner = 0;
}
}
else if((board[2][0] == 0) && (Player == 2)) {
board[2][0] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 8, 109, 34, 34);
Bdisp_PutDisp_DD();
board[2][0] = 2;
Winner = 0;
Player = 1;
}
else {
board[2][0] = 0;
Winner = 0;
}
}
else if((board[3][0] == 0) && (Player == 2)) {
board[3][0] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 8, 73, 34, 34);
Bdisp_PutDisp_DD();
board[3][0] = 2;
Winner = 0;
Player = 1;
}
else {
board[3][0] = 0;
Winner = 0;
}
}
else if((board[4][0] == 0) && (Player == 2)) {
board[4][0] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 8, 37, 34, 34);
Bdisp_PutDisp_DD();
board[4][0] = 2;
Winner = 0;
Player = 1;
}
else {
board[4][0] = 0;
Winner = 0;
}
}
else if((board[5][0] == 0) && (Player == 2)) {
board[5][0] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 8, 2, 34, 34);
Bdisp_PutDisp_DD();
board[5][0] = 2;
Winner = 0;
Player = 1;
}
else {
board[5][0] = 0;
Winner = 0;
}
}
CheckForWinner();
if((board[0][1] == 0) && (Player == 2)) {
board[0][1] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 59, 181, 34, 34);
Bdisp_PutDisp_DD();
board[0][1] = 2;
Winner = 0;
Player = 1;
}
else {
board[0][1] = 0;
Winner = 0;
}
}
else if((board[1][1] == 0) && (Player == 2)) {
board[1][1] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 59, 145, 34, 34);
Bdisp_PutDisp_DD();
board[1][1] = 2;
Winner = 0;
Player = 1;
}
else {
board[1][1] = 0;
Winner = 0;
}
}
else if((board[2][1] == 0) && (Player == 2)) {
board[2][1] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 59, 109, 34, 34);
Bdisp_PutDisp_DD();
board[2][1] = 2;
Winner = 0;
Player = 1;
}
else {
board[2][1] = 0;
Winner = 0;
}
}
else if((board[3][1] == 0) && (Player == 2)) {
board[3][1] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 59, 73, 34, 34);
Bdisp_PutDisp_DD();
board[3][1] = 2;
Winner = 0;
Player = 1;
}
else {
board[3][1] = 0;
Winner = 0;
}
}
else if((board[4][1] == 0) && (Player == 2)) {
board[4][1] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 59, 37, 34, 34);
Bdisp_PutDisp_DD();
board[4][1] = 2;
Winner = 0;
Player = 1;
}
else {
board[4][1] = 0;
Winner = 0;
}
}
else if((board[5][1] == 0) && (Player == 2)) {
board[5][1] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 59, 2, 34, 34);
Bdisp_PutDisp_DD();
board[5][1] = 2;
Winner = 0;
Player = 1;
}
else {
board[5][1] = 0;
Winner = 0;
}
}
CheckForWinner();
if((board[0][2] == 0) && (Player == 2)) {
board[0][2] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 110, 181, 34, 34);
Bdisp_PutDisp_DD();
board[0][2] = 2;
Winner = 0;
Player = 1;
}
else {
board[0][2] = 0;
Winner = 0;
}
}
else if((board[1][2] == 0) && (Player == 2)) {
board[1][2] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 110, 145, 34, 34);
Bdisp_PutDisp_DD();
board[1][2] = 2;
Winner = 0;
Player = 1;
}
else {
board[1][2] = 0;
Winner = 0;
}
}
else if((board[2][2] == 0) && (Player == 2)) {
board[2][2] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 110, 109, 34, 34);
Bdisp_PutDisp_DD();
board[2][2] = 2;
Winner = 0;
Player = 1;
}
else {
board[2][2] = 0;
Winner = 0;
}
}
else if((board[3][2] == 0) && (Player == 2)) {
board[3][2] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 110, 73, 34, 34);
Bdisp_PutDisp_DD();
board[3][2] = 2;
Winner = 0;
Player = 1;
}
else {
board[3][2] = 0;
Winner = 0;
}
}
else if((board[4][2] == 0) && (Player == 2)) {
board[4][2] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 110, 37, 34, 34);
Bdisp_PutDisp_DD();
board[4][2] = 2;
Winner = 0;
Player = 1;
}
else {
board[4][2] = 0;
Winner = 0;
}
}
else if((board[5][2] == 0) && (Player == 2)) {
board[5][2] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 110, 2, 34, 34);
Bdisp_PutDisp_DD();
board[5][2] = 2;
Winner = 0;
Player = 1;
}
else {
board[5][2] = 0;
Winner = 0;
}
}
CheckForWinner();
if((board[0][3] == 0) && (Player == 2)) {
board[0][3] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 161, 181, 34, 34);
Bdisp_PutDisp_DD();
board[0][3] = 2;
Winner = 0;
Player = 1;
}
else {
board[0][3] = 0;
Winner = 0;
}
}
else if((board[1][3] == 0) && (Player == 2)) {
board[1][3] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 161, 145, 34, 34);
Bdisp_PutDisp_DD();
board[1][3] = 2;
Winner = 0;
Player = 1;
}
else {
board[1][3] = 0;
Winner = 0;
}
}
else if((board[2][3] == 0) && (Player == 2)) {
board[2][3] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 161, 109, 34, 34);
Bdisp_PutDisp_DD();
board[2][3] = 2;
Winner = 0;
Player = 1;
}
else {
board[2][3] = 0;
Winner = 0;
}
}
else if((board[3][3] == 0) && (Player == 2)) {
board[3][3] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 161, 73, 34, 34);
Bdisp_PutDisp_DD();
board[3][3] = 2;
Winner = 0;
Player = 1;
}
else {
board[3][3] = 0;
Winner = 0;
}
}
else if((board[4][3] == 0) && (Player == 2)) {
board[4][3] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 161, 37, 34, 34);
Bdisp_PutDisp_DD();
board[4][3] = 2;
Winner = 0;
Player = 1;
}
else {
board[4][3] = 0;
Winner = 0;
}
}
else if((board[5][3] == 0) && (Player == 2)) {
board[5][3] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 161, 2, 34, 34);
Bdisp_PutDisp_DD();
board[5][3] = 2;
Winner = 0;
Player = 1;
}
else {
board[5][3] = 0;
Winner = 0;
}
}
CheckForWinner();
if((board[0][4] == 0) && (Player == 2)) {
board[0][4] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 212, 181, 34, 34);
Bdisp_PutDisp_DD();
board[0][4] = 2;
Winner = 0;
Player = 1;
}
else {
board[0][4] = 0;
Winner = 0;
}
}
else if((board[1][4] == 0) && (Player == 2)) {
board[1][4] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 212, 145, 34, 34);
Bdisp_PutDisp_DD();
board[1][4] = 2;
Winner = 0;
Player = 1;
}
else {
board[1][4] = 0;
Winner = 0;
}
}
else if((board[2][4] == 0) && (Player == 2)) {
board[2][4] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 212, 109, 34, 34);
Bdisp_PutDisp_DD();
board[2][4] = 2;
Winner = 0;
Player = 1;
}
else {
board[2][4] = 0;
Winner = 0;
}
}
else if((board[3][4] == 0) && (Player == 2)) {
board[3][4] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 212, 73, 34, 34);
Bdisp_PutDisp_DD();
board[3][4] = 2;
Winner = 0;
Player = 1;
}
else {
board[3][4] = 0;
Winner = 0;
}
}
else if((board[4][4] == 0) && (Player == 2)) {
board[4][4] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 212, 37, 34, 34);
Bdisp_PutDisp_DD();
board[4][4] = 2;
Winner = 0;
Player = 1;
}
else {
board[4][4] = 0;
Winner = 0;
}
}
else if((board[5][4] == 0) && (Player == 2)) {
board[5][4] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 212, 2, 34, 34);
Bdisp_PutDisp_DD();
board[5][4] = 2;
Winner = 0;
Player = 1;
}
else {
board[5][4] = 0;
Winner = 0;
}
}
CheckForWinner();
if((board[0][5] == 0) && (Player == 2)) {
board[0][5] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 263, 181, 34, 34);
Bdisp_PutDisp_DD();
board[0][5] = 2;
Winner = 0;
Player = 1;
}
else {
board[0][5] = 0;
Winner = 0;
}
}
else if((board[1][5] == 0) && (Player == 2)) {
board[1][5] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 263, 145, 34, 34);
Bdisp_PutDisp_DD();
board[1][5] = 2;
Winner = 0;
Player = 1;
}
else {
board[1][5] = 0;
Winner = 0;
}
}
else if((board[2][5] == 0) && (Player == 2)) {
board[2][5] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 263, 109, 34, 34);
Bdisp_PutDisp_DD();
board[2][5] = 2;
Winner = 0;
Player = 1;
}
else {
board[2][5] = 0;
Winner = 0;
}
}
else if((board[3][5] == 0) && (Player == 2)) {
board[3][5] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 263, 73, 34, 34);
Bdisp_PutDisp_DD();
board[3][5] = 2;
Winner = 0;
Player = 1;
}
else {
board[3][5] = 0;
Winner = 0;
}
}
else if((board[4][5] == 0) && (Player == 2)) {
board[4][5] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 263, 37, 34, 34);
Bdisp_PutDisp_DD();
board[4][5] = 2;
Winner = 0;
Player = 1;
}
else {
board[4][5] = 0;
Winner = 0;
}
}
else if((board[5][5] == 0) && (Player == 2)) {
board[5][5] = 1;
CheckForWinner();
if(Winner == 1) {
CopySprite(black, 263, 2, 34, 34);
Bdisp_PutDisp_DD();
board[5][5] = 2;
Winner = 0;
Player = 1;
}
else {
board[5][5] = 0;
Winner = 0;
}
}
CheckForWinner();