I have this 2d array called input and I am trying to map different numbers in another array to change it. In the 2d array mapping it contains all the mappings I want to perform.The first array is {0,2,3,4,1,5} and I want to use this to change the values in input so every 1 becomes a 2, and 2 to 3 and 3 to 4 and 4 to 1. I have 23 different mappings in that mapping array which I would want to change the values of input. Here is what I have tried so far.
public static int [][] mapOrientation(int input[][]){
int [][] input = {{0,0,0,5},{4,1,1,4},{2,2,0,2},{1,2,3,5},{3,3,3,4},{1,5,5,4}};
int[][] mapping ={{0,2,3,4,1,5},{1,2,0,4,5,3},{5,2,1,4,3,0},{3,2,5,4,0,1},
{3,5,4,0,2,1},{2,5,3,0,1,4},{1,5,2,0,4,3},{4,5,1,0,3,2},
{4,1,0,3,5,2},{5,1,4,3,2,0},{2,1,5,3,0,4},{0,1,2,3,4,5},
{0,4,1,2,3,5},{3,4,0,2,5,1},{5,4,3,2,1,0},{1,4,5,2,0,3},
{1,0,4,5,2,3},{2,0,1,5,3,4},{3,0,2,5,4,1},{4,0,3,5,1,2},
{4,1,0,3,5,2},{5,1,4,3,2,0},{2,1,5,3,0,4}};
int [] comb = mapping[0];
for(int i = 0; i < input.length; i++){
for(int j = 0; j < input[i].length; j++){
input[i][j] = comb[0];
System.out.println(comb[0]);
System.out.println(Arrays.deepToString(input));
cubeToString = Arrays.deepToString(input);
return input;
}
If this is still unclear my goal is to change input from
int [][] input ={{5,1,2,0},{2,0,1,4},{1,2,5,5},{3,0,1,3},{4,3,0,4},{3,2,5,4}}
to:
int [][] input ={{5,2,3,0},{3,0,2,1},{2,3,5,5},{4,0,2,4},{1,4,0,1},{4,3,5,1}}
This would be the result I want using comb[0].
inputso I usecomb[0]to access the first mapping array @RAZ_Muh_Tazthe mapping arrays contain the combination of mappings? how does it work ?0 -> 0, 1-> 2, 2 -> 3, 3 -> 4, 4 -> 1is the first combination. @Michael