Skip to content

Instantly share code, notes, and snippets.

@Morzanne
Created May 10, 2019 14:38
Show Gist options
  • Save Morzanne/1ef127dfe0d2a91a4a60898e9924eb2a to your computer and use it in GitHub Desktop.
Save Morzanne/1ef127dfe0d2a91a4a60898e9924eb2a to your computer and use it in GitHub Desktop.
public class Decipherer {
public static String automatisation(String code){
int longueur = code.length() / 2;
String substr = code.substring(5,(longueur+5));
String replace = substr.replace("@#?"," ");
String reverse = new StringBuilder(replace).reverse().toString();
return reverse;
}
public static void main(String[] args) {
String firstCode = "0@sn9sirppa@#?ia'jgtvryko1";
String secondCode = "q8e?wsellecif@#?sel@#?setuotpazdsy0*b9+mw@x1vj";
String thirdCode = "aopi?sedohtém@#?sedhtmg+p9l!";
System.out.println(automatisation(firstCode)+" "+(automatisation(secondCode))+" "+(automatisation(thirdCode)));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment