Question: Java-programming. How can I make the code below update the coordinates for pos[X] and pos[Y] everytime i type in a number? I would like it

Java-programming. How can I make the code below update the coordinates for pos[X] and pos[Y] everytime i type in a number?

I would like it to work, so if the beginning coordinates are (0,0) and I enter 6, the variable pos will become pos=[1,0], or by entering 2 it becomes [0,1], I have put a picture of the window output I want to achieve, where there's been pressed 6, 2, 6, 9.

Java-programming. How can I make the code below update the coordinates forpos[X] and pos[Y] everytime i type in a number? I would like

it to work, so if the beginning coordinates are (0,0) and I

public class RaceTrack t final static int x = 0; final static int Y = 1; static List IineCoordinates = new ArrayList; // List with a.! the ines between dots static int moves; // Counter for the number of moves used to finish the course static int pos = new int[2]; // The current position static int oldPos = new int[2]; // The previous position static int[] distance = new int[2]; // Vector between old position and new position static boolean middleCrossed; static boolean clockwise; static boolean sideCrossed; static boolean goal

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!