I'm making a game... and for it we have our own language. I stripped out all the fancy html to help make things a little clearer for someone trying to help me.
<SCRIPT LANGUAGE="JavaScript">
<!--
function translate(form){
var alpha='ABCDEFGHIJKLMNOPQRSTUVWXYZURKPAVDHEQCLNMYGWJTSOBFZIX';
var x = 0;
var raw = form.raw.value;
for (x = 0; x <= raw.length; x++){
var part = raw.substring(x, x+1);
if (part >= 'A' && part <= 'Z'){ var letters = "upper" }
if (part >= 'a' && part <= 'z'){ var letters = "lower" }
var part = part.toUpperCase();
if (part >= 'A' && part <= 'Z'){
part = alpha.charAt(alpha.indexOf(part) + 26);
if (letters == "lower"){ part = part.toLowerCase() }
}
form.cooked.value = form.cooked.value + part;
}
}
// -->
</SCRIPT>
English
<TEXTAREA NAME="raw" COLS="50" ROWS="15"></TEXTAREA>
Ramathian
<TEXTAREA NAME="cooked" COLS="50" ROWS="15"></TEXTAREA>
<INPUT TYPE="button" onClick="translate(this.form)" value=http://www.webdeveloper.com/forum/archive/index.php/"Translate">
All it does is substitute the letters A to Z with a new set of letters that we've assigned for each one.
English:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Ramathian:
U R K P A V D H E Q C L N M Y G W J T S O B F Z I X
So A = U, Z = X, and so on.
What I /want/ it to have is some sort of modification so that I can use a drop down menu to easily translate text back and forth between English and "Ramathian". I also want to add variables so that if a user enters the word "dog" for instance, it'll print out something like "cateater" instead of "pyd". If anyone has any clue as to how to do this, or knows of somewhere that could help me out, I'd greatly appreciate it.
<SCRIPT LANGUAGE="JavaScript">
<!--
function translate(form){
var alpha='ABCDEFGHIJKLMNOPQRSTUVWXYZURKPAVDHEQCLNMYGWJTSOBFZIX';
var x = 0;
var raw = form.raw.value;
for (x = 0; x <= raw.length; x++){
var part = raw.substring(x, x+1);
if (part >= 'A' && part <= 'Z'){ var letters = "upper" }
if (part >= 'a' && part <= 'z'){ var letters = "lower" }
var part = part.toUpperCase();
if (part >= 'A' && part <= 'Z'){
part = alpha.charAt(alpha.indexOf(part) + 26);
if (letters == "lower"){ part = part.toLowerCase() }
}
form.cooked.value = form.cooked.value + part;
}
}
// -->
</SCRIPT>
English
<TEXTAREA NAME="raw" COLS="50" ROWS="15"></TEXTAREA>
Ramathian
<TEXTAREA NAME="cooked" COLS="50" ROWS="15"></TEXTAREA>
<INPUT TYPE="button" onClick="translate(this.form)" value=http://www.webdeveloper.com/forum/archive/index.php/"Translate">
All it does is substitute the letters A to Z with a new set of letters that we've assigned for each one.
English:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Ramathian:
U R K P A V D H E Q C L N M Y G W J T S O B F Z I X
So A = U, Z = X, and so on.
What I /want/ it to have is some sort of modification so that I can use a drop down menu to easily translate text back and forth between English and "Ramathian". I also want to add variables so that if a user enters the word "dog" for instance, it'll print out something like "cateater" instead of "pyd". If anyone has any clue as to how to do this, or knows of somewhere that could help me out, I'd greatly appreciate it.