Hi Guys,
I know i have posted quiyte a bit in the past couple of days and really greatful for all the help but i have hit a dead end again and been trying to figure it out for a few days now.
Right this is what i am trying to achive
I have a 2d array (blockarray[][]) which contains bytes of data and what i am trying to do is put each colomn into a String via a specic order which is set by the1d array (int[] colprintorder = new int[numberofcols]; ) which is the length of the 2d array containing the numbers 0-the number of coloumns in the array. This is the order i want each coloumn to be printed out (i know the order makes no sense its part of a transposition cipher thing).
So if you have a look at the photo above it may help you undfer stand what im trying to do . the black text is the byte array of the data, the orange array is the list i want each colom of the black array put into a single string. the green arrow is just demonstarating that im trying to print out the column and not row. So coloumn 8 (the one with the orange 0 above) will be printed out first then column 9 and so on till all the columns have been printed
you see the last 10 entrys are "21" i want these to be ignored so i tried creating a if between 32-177 (this range is beacuse it equals all usable characters on a english keyboard).
here is the code i have produced to try and do this
boolean end = false; int mewo=0; while(end==false) { if(her==colprintorder.length) { end = true; } for (int posloop=0; posloop <colprintorder.length; posloop++) { if(colprintorder[posloop]==mewo) { for (int b=0; b<4;b++) { cipherchararray[her] = (char)(byte) BlockArray[b][mewo]; } her++; } } } String covertedChars = new String(cipherchararray);
at the moment im getting no where can anyone help me figure this out please .. thank you