//THIS IS THE CODE I HAVE SO FAR: import java.util.Arrays; import java.util.Scanner; import java.io.File; import java.io.FileWriter; import java.awt.event.KeyEvent; import javax.swing.JOptionPane; public class GridInput { static int X = 6; static int Y = 7; public static void main(String[]args) { String [][] Grid = new String [X][Y]; System.out.println("Hello R, please make your move! Choose a number from 0-6"); int R = StdIn.readInt(); System.out.print(" "); for (int i = 0; i <= X; i++) { if (i > 0) { System.out.print(i - 1); } for (int j = 0; j < Y; j++) { if (i == 0) System.out.print(j + " "); else; System.out.print(Grid[i-1][j] = " *"); } System.out.println(); } } }
//WHAT I WANT TO PRINT LOOKS LIKE THIS (SAY USER INPUT FOR R IS "4"):
0 1 2 3 4 5 6
0 * * * * * * * *
1 * * * * * * * *
2 * * * * * * * *
3 * * * * * * * *
4 * * * * * * * *
5 * * * * * R * *
//THEN THERE SHOULD BE ANOTHER USER INPUT WHICH CHANGES THE GRID AGAIN.
//IF THE SECOND USER INPUT IS 4 AGAIN:
0 1 2 3 4 5 6
0 * * * * * * * *
1 * * * * * * * *
2 * * * * * * * *
3 * * * * * * * *
4 * * * * * R * *
5 * * * * * R * *
//I WANT THE GRID TO LOOK EXACTLY LIKE THIS