ArrayList<String> mylist = new ArrayList<String>();
build2 = "";
String[] source = file2.split(" ");
for(int i = 0; i < source.length; i++){
int offset = mylist.indexOf(source[i]);
if(Arrays.asList(source).equals(mylist)){
build2 += (char)(65 + offset);
}
}
System.out.println("\nYour decrypted message is: \n" + build2);
This is a encryption and decryption project. Right now the string array mylist contains a bunch of unicodes for poker cards. And my array source contains poker cards and number.
I would like to check, if there are poker cards in the array then display-
build2 += (char)(65 + offset); (which converts certain poker cards to letters)
My full code is here - https://repl.it/@MatthewZeman/DecryptionCode https://repl.it/@MatthewZeman/EncryptionCode
input -
🃁 36 🂱 36 🂡
output -
ABC
if(Arrays.asList(source).equals(mylist)){will never equal true, that is why you don't get any output asbuild2will never be mutated