Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Mips Assembly Language In this problem, we will ssmble the parts of previous In

ID: 3674074 • Letter: M

Question

Mips Assembly Language

In this problem, we will ssmble the parts of previous In this problem, we will assemble the parts of previous homework assignments into a working version of the game of draughts. First the board must be initialized with an initial position. Next, you need to have your program enter a game loop where red and white take turns making moves. You will need to use your isValidMove(), and isValidJump) functions to check if a user is trying to do something illegal or not. Finally, you need to use your printBoard() function to view the game. The game implementation will be for two users so you do not need to program the computer to play against a user. Also, you do not need to program all the rules of the game.

Explanation / Answer

a)for(r=0;r<2;r++)

{

for(c=0;c<8;c++)

{

if((r1,c1)==curColor)

printf("add red game piece");

}

}

}

for(r=5;r<=7;r++){

for(c=0;c<8;c++){

if((r5,c0)!=curColor)

{

printf("add white game piece");

}

}

}

b)for(i=0;i<64;i++)

{

int curColor=0;

for(i=0;i<12;i++)

{

printf("print the board");

printf("ask the user to enter r1,c1,r2,c2);

scanf("%dr1,%dc1,%dr2,%dc2",&r1,&r2,&c1,&c2");

int rpc=12;

int wpc=12;

if(((r1,c1)==curColor)&&(ValidJump==((r1,,c1) &&(r2,c2))))

{

printf(it is avalid move from r1,c1 to r2,c2);

rm=(r1+r2)/2;

cm=(c1+c2)/2;

if((curColor)==0){

rpc--;

else

wpc--;}

if(rpc==0 ||wpc==0))

printf("exit");

else if(((r1,c1)==curColor)&&(ValidMove==((r1,c1) &&(r2,c2))))

(r1,c1)=(r2,c2);}

if(curColor==0)

curColor=1;

else

curColor=0;

printf("exit");

printf("The winning color is");

}

}

}