I'm trying to make a Albhed Converter from FFX. But the Letters wont covert right. Can someone help me?
The Output:
Push 1 to convert English to AlBhed
Push 2 to convert AlBhed to English
1
Enter the phase you wish to convet to AlBhed.
A
A Means...
O
But the letter A should be Y not O. Please Help
/** * @(#)AlBhedCoverter.java * * AlBhedCoverter application * * @author * @version 1.00 2013/7/26 */ import java.util.*; import java.io.*; import javax.swing.*; import java.util.Scanner; public class AlBhedCoverter { public static void main(String[] args) { Scanner input = new Scanner(System.in); Scanner keyboard = new Scanner(System.in); AlBhed x = new AlBhed(); English y = new English(); System.out.println("Push 1 to convert English to AlBhed"); System.out.println("Push 2 to convert AlBhed to English"); int choice1 = keyboard.nextInt(); switch (choice1) { case 1: x.AlBhedCov(); break; case 2: y.EnglishCov(); break; } } }
/** * @(#)AlBhed.java * * * @author * @version 1.00 2013/7/26 */ import java.util.*; import java.io.*; import javax.swing.*; import java.util.Scanner; public class AlBhed { public void AlBhedCov() { Scanner keyboard = new Scanner(System.in); String letter = " "; System.out.println("Enter the phase you wish to convet to AlBhed."); letter = keyboard.nextLine(); System.out.println(letter + " Means..."); String newLetter = letter.replaceAll("A","Y") .replaceAll("a","y") .replaceAll("B","P") .replaceAll("b","p") .replaceAll("C","L") .replaceAll("c","l") .replaceAll("D","T") .replaceAll("d","t") .replaceAll("E","A") .replaceAll("e","a") .replaceAll("F","V") .replaceAll("f","v") .replaceAll("G","K") .replaceAll("g","k") .replaceAll("H","R") .replaceAll("h","r") .replaceAll("I","E") .replaceAll("i","e") .replaceAll("J","Z") .replaceAll("j","z") .replaceAll("K","G") .replaceAll("k","g") .replaceAll("L","M") .replaceAll("l","m") .replaceAll("M","S") .replaceAll("m","s") .replaceAll("N","H") .replaceAll("n","h") .replaceAll("O","U") .replaceAll("o","u") .replaceAll("P","B") .replaceAll("p","b") .replaceAll("Q","X") .replaceAll("q","x") .replaceAll("R","N") .replaceAll("r","n") .replaceAll("S","C") .replaceAll("s","c") .replaceAll("T","D") .replaceAll("t","d") .replaceAll("U","I") .replaceAll("u","i") .replaceAll("V","J") .replaceAll("v","j") .replaceAll("W","F") .replaceAll("w","f") .replaceAll("X","Q") .replaceAll("x","q") .replaceAll("Y","O") .replaceAll("y","o") .replaceAll("Z","W") .replaceAll("z","w"); System.out.println(newLetter); } }
/** * @(#)English.java * * * @author * @version 1.00 2013/7/26 */ import java.util.*; import java.io.*; import javax.swing.*; import java.util.Scanner; public class English { public void EnglishCov() { Scanner keyboard = new Scanner(System.in); String letter = " "; System.out.println("Enter the phase you wish to convet to English."); letter = keyboard.nextLine(); System.out.println(letter + " Means..."); String newLetter = letter.replaceAll("Y","A") .replaceAll("y","a") .replaceAll("P","B") .replaceAll("p","b") .replaceAll("L","C") .replaceAll("l","c") .replaceAll("T","D") .replaceAll("t","d") .replaceAll("A","E") .replaceAll("a","e") .replaceAll("V","F") .replaceAll("v","f") .replaceAll("K","G") .replaceAll("k","g") .replaceAll("R","H") .replaceAll("r","h") .replaceAll("E","I") .replaceAll("e","i") .replaceAll("Z","J") .replaceAll("z","J") .replaceAll("G","k") .replaceAll("g","k") .replaceAll("M","L") .replaceAll("m","l") .replaceAll("S","M") .replaceAll("s","m") .replaceAll("H","N") .replaceAll("h","n") .replaceAll("U","O") .replaceAll("u","o") .replaceAll("B","P") .replaceAll("b","p") .replaceAll("X","Q") .replaceAll("x","q") .replaceAll("N","R") .replaceAll("n","r") .replaceAll("C","S") .replaceAll("c","s") .replaceAll("D","T") .replaceAll("d","t") .replaceAll("I","U") .replaceAll("i","u") .replaceAll("J","V") .replaceAll("j","v") .replaceAll("F","W") .replaceAll("f","w") .replaceAll("Q","X") .replaceAll("q","X") .replaceAll("O","Y") .replaceAll("o","y") .replaceAll("W","Z") .replaceAll("w","z"); System.out.println(newLetter); } }