create event:
alpha_src = " 0123456789abcdefghijklmnopqrstuwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";//Plain Text
alpha_dst = "tuwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789abcdefghijklmnopqrs";//Encoded Text
text1 = get_string("Source:", "");//Get string to convert
index = 1;//position in Plain text
str = ""; // result
for (var index = 1; index < string_length(text1)+1; index += 1)
{
char = string_char_at(text1, index);//get character at position in string
pos = string_pos(char, alpha_src);//find position of letter in Plain Text
if (pos > 0)
{
// if char occurs in source alphabet, add
// according one from destination alphabet
// to output
str += string_char_at(alpha_dst, pos);//At letter from position in Encoded
}
else
{
// otherwise just add itself
str += char;
}
}
result=str;//result is finished encoded
show_message(result);//show encoded message
Search thousands of free JavaScript snippets that you can quickly copy and paste into your web pages. Get free JavaScript tutorials, references, code, menus, calendars, popup windows, games, and much more.
Subscribe to:
Post Comments (Atom)
The Win Machine
The Road to Hell is Paved with Intervention ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ...
-
code.gs // 1. Enter sheet name where data is to be written below var SHEET_NAME = "Sheet1" ; // 2. Run > setup // // 3....
No comments:
Post a Comment