我想用我自己的字母表为android做一个Caesar密码设计应用程序

时间:2017-04-16 12:22:44

标签: caesar-cipher

这是我的字母:

char[] alphabet = {'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'}; 

我是用英文字母制作的,但我不知道如何处理它。

1 个答案:

答案 0 :(得分:0)

这是我的Javascript代码:

var alphabet = ["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"];
for(var a=0;a<alphabet.length;a++) {
    for(var b=0;b<alphabet.length;b++) {
        var index = b+a;
        if(index >= alphabet.length) {
            index -= alphabet.length;
        }
        console.log(index);
        document.write(alphabet[index]);
    }
    document.write("<br>");
}  

告诉我这是否有效。