Language Translator

How do i make a Language Translator on anytype of language, C++, VB, Java, Etc.?
I need to make a translator to translate a cipher laguage me and my freind created, how do i make a translator??
You have made a cipher language with what they call bindings for each letter of the alphabet.
Let’s take an example for the old Ceasar cipher. This cipher was created by Julius ceasar and is pretty basic. It just moves the alphabet a certain amount of numbers to the left. So let’s say the number it moves is 2.
If you type in C in the code, it would be translated as an A. A being 2 letter behind C, or A + 2 = C, or C – 2 = A.
Hopefully you get that, because I will work for that example.
So if you were to implement the Ceasar cipher, you would create a list, or array of the alphabet.
static char ALPHABET[] = {‘A’, ‘B’, ‘C’, ‘D’, etc};
Then you would get the code you want to decipher. So just say it said something like “FCJJM UNPJB” which in English would be “HELLO WORLD”
So, you would go through the string “FCJJM UNPJB” changing every letter to the letter it should be.
In Java you would do something like this.
char deciphered = word.toCharArray();
for (int i = 0; i < word.length(); i++) // where word is the string
int charValue = (int) deciphered[i] – 97; // minus 97 as the ASCII code for A is 97.
Now, you would want to find out if the charValue is below 2. If it is, you would add 26 – 2 to the charvalue to get the next letter.
For example, A would be 0, and you want to get 24, which is Y.
B would be 1, and you would get 25, which is Z.
If the charValue is 2 or above, you would just minus 2 from the charValue. C (2) would give you A (0).
if (charValue < 2)
charValue = charValue + 26 – 2;
else
charValue = charValue – 2;
Then change the char in deciphered.
deciphered[i] = ALPHABET[charValue];
} // end for loop
Ok, to get back to your example. if your code does not change, and you know that A refers to an S always, and B refers to an F always, you could do something like this.
Create an array of the alphabet as above.
Create another array of the letters that are for the letters of the alphabet.
static char CODE = {'S', 'F', etc};
The do the same for loop as above, but this time instead of changing the value of the charValue to -2 etc, do this.
deciphered[i] = CODE[ ALPHABET[ charValue ]];
Hope that is understandable. If not click on my profile and email me and I can explain more.
katherine tate language translator
|
|
FRANKLIN TRANSLATOR 12 LANGUAGES FRTJS12 $49.95 |
|
|
Medical Language Instant Translator by Davi-Ellen Chabner (2007, Paperback) $9.95 |
|
|
NEW 2012 TRAVEL LINGO VOYAGER 7 20 LANGUAGE TALKING TALK TRANSLATOR TTV-7 BONUS $184.00 |
|
|
6-Language Pocket Translator *NEW* Eng, Spanish, French, German, Italian, Dutch $2.99 |
|
|
Lingo Euromate 5-language Translator – Lingo EM-5 $24.99 |
|
|
New 6 Language Translator $9.99 |
|
|
Franklin FR-TXF5 5-Language European Translator SPECIAL $25.98 |
|
|
Translator Hand Held, 6 Languages, has clock, calendar and calculator $1.00 |
|
|
Lingo 8 Language Translator Spanish, French, Italian .. $10.00 |
|
|
Franklin Twe-118 5 Language European Translator – 2 Lines Display (twe118) $21.17 |
|
|
Ectaco 500AL Oxford Multi-Language Electronic Translator – Oxford500AL $110.00 |
|
|
Lingo TR2000-20 Language Global Traveler Translator $57.83 |
|
|
Lingo TR4400-World Traveler 44 Language Translator $88.96 |
|
|
Franklin Fr-txf5 5-language European Translator (frtxf5) $21.56 |
|
|
Lingo Global 6 translator- 6 Languages: English, Spanis $20.19 |
|
|
Lingo 6 language translator – English, German, French, $18.99 |
|
|
6 LANGUAGE TRANSLATOR FRENCH ITALIAN GERMAN SPANISH DUTCH *NEW* $12.00 |
|
|
Lingo Translator Worldtalk traveler 12 languages TT-12000 $129.95 |
|
|
WordAce: French PC CD translate languages, words tools! $16.99 |
|
|
Lingo TR4400 World Traveler 44 language translator – Translates o $104.39 |
|
|
Lingo 15 language talking phrase translator- Chinese, D $83.39 |
|
|
Lingo Ambassador talking translator 40 language transla $191.79 |
|
|
Lingo Euro 5 language talking translator- Tranlates and $89.79 |
|
|
Krown sign language translator- Touch screen display- B $213.79 |
|
|
Lingo Eurotalk traveler talking translator- 6 Languages $137.39 |
|
|
Lingo Voyager 7 20 language talking translator- English $199.95 |
|
|
Lingo TravelMate 16 language translator- Translates ove $49.99 |
|
|
Lingo eTerpreter 12 language talking translator- Input $226.99 |
|
|
LingoGlobal Traveler 20 language translator- Translates $79.99 |
|
|
Lingo talking translator- 14 Languages – English, Germa $199.95 |
|
|
Franklin TGA-490 12 Language Speaking Global Translator (New In Box) $129.00 |
|
|
# IMSI Easy Language Multi-Lingual Dictionary 25 World Languages Word Translator $4.95 |
|
|
Franklin 14-Language Speaking Global Translator FR-S1400 $30.00 |
|
|
NEW OPEN BOX Franklin 14 Language Speaking Translator Merriam-Webster Dictionary $52.00 |
|
|
Franklin Electronic 5 Language Translator English French German Spanish Italian $17.95 |
|
|
Ectaco ML350 English to 10 Language Travel Translator $29.00 |
|
|
English Language Bible Translators NEW by William E. Pa $69.18 |
|
|
SHARPER IMAGE 10 LANGUAGE TRANSLATOR ORGANIZER SCHEDULE Electronic Computer Diar $35.00 |
|
|
*NEW* 52 LANGUAGES TRANSLATOR ELECTRONIC DICTIONARY $78.14 |