I have just completed my java code for the game engine maze I have been working on. We are told to download MARS and from java code it in assembly. I have never learned assembly. So I am completely lost. I so far downloaded MARS and uploaded my java code. Where do I go from here. This is my first time even hearing of assembly. I'm completely lost. Please help if you can. Thanks.
import java.util.Scanner;
import java.util.Random;
public class robot
{
public static void maX]
iin (String args [])
{
int robot_x = 0;//int starts at 0
int robot_y = 0;
int robot_m_x = 0;
int robot_m_y = 0;
int[] robot_instructions = new int[64];// maze
int[][] maze = new int[9][9];//grid
//int i = 0;
int robot_state = 0;
robot_instructions[0] = 1;
maze[1][2] = 2;//chasm
maze[2][3] = 3;//trap
maze[1][1] = 1;//safe
maze[3][2] = 4;//destination
maze[3][4] = 3;//trap
maze[2][4] = 2;//chasm
robot_x = 1;
robot_y = 2;
robot_state = 5;
Random rand = new Random();//no set numbers performs random
for(int i = 0; i < 64; i++)
{
robot_instructions[i]=rand.nextInt(5);
switch(robot_instructions[i])
{
case 1:robot_x = robot_m_x;
robot_y = robot_m_y + 1; //move
break;
case 2:robot_x = robot_m_x;
robot_y = robot_m_y + 2 ; //jump
break;
case 3:
robot_x = robot_m_x - 1; //Left
break;
case 4:
robot_x = robot_m_x + 1; //Right
break;
}
//}
System.out.println("Robot final location X: " + robot_x + " Y: " + robot_y);
System.out.println ("Robot State: ");
if (( (robot_x == 1) && (robot_y == 2)) || ( (robot_x == 2) && (robot_y == 4)) )
{
System.out.println("Robot has fallen into a chasm");
robot_state = 2;
}
else if(( (robot_x == 2) && (robot_y == 3)) || ((robot_x == 3) && (robot_y == 4)))
{
System.out.println("Robot has fallen into a trap");
robot_state = 3;
}
else if((robot_x == 3) && (robot_y == 2))
{
System.out.println("Robot has reached Destination");
robot_state = 4;
}
else
{
System.out.println("Robot is at a safe place");
robot_state = 1;
}
switch(robot_state)
{
case 1:robot_state = 1; //safe
System.out.println ( "Robot is at a safe place");
break;
case 2:robot_state = 2; //chasm
System.out.println ( "Robot falls into Chasm");
break;
case 3:robot_state = 3; //trap
System.out.println ("Robot falls into the trap");
break;
case 4:robot_state = 4; //destination
System.out.println ( "Robot reaches Destination");
break;
case 5:robot_state = 5; //Failed
System.out.println ( "Robot fails to reach Destination");
break;
}
}
}
}