Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- init()
- {
- level.russian_down = "абвгдежзийклмнопрстуфхцчшщъыьэюя";
- level.russian_up = "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ";
- }
- isUpperChar(c)
- {
- asc = getAscii(c);
- if (asc < -32 && asc >= -64)
- return true;
- return false;
- }
- toLowerChar(c)
- {
- if (isUpperChar(c))
- {
- asc = getAscii(c);
- return level.russian_down[asc+64];
- }
- else
- return c;
- }
- toLower(str)
- {
- newstr = "";
- for (i=0; i<str.size; i++)
- {
- newstr += toLowerChar(str[i]);
- }
- return newstr;
- }
- isRussianPlayer()
- {
- if (!isdefined(self.country_code))
- {
- printf("self.country_code is not defined \n");
- return false;
- }
- if (self.language == 6 ||
- self.country_code == "RU" ||
- self.country_code == "LV" ||
- self.country_code == "UA" ||
- self.country_code == "KZ" ||
- self.country_code == "BY")
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- isRussianText(text)
- {
- count = 0;
- for (i=0; i<text.size; i++)
- {
- asc = getAscii(text[i]);
- if (asc <= -1 && asc >= -64)
- count++;
- }
- if (count > int(text.size/2))
- return true;
- else
- return false;
- }
- stringIsCommonCharsOnly(str)
- {
- good = "1234567890!@#$%^&*()-_=+qwertyuiop[]QWERTYUIOP{}\|asdfghjkl;'ASDFGHJKL:zxcvbnm,./ZXCVBNM<>?йцукенгшщзхъфывапролджэячсмитьбюЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ";
- count = 0;
- for (i=0; i<str.size; i++)
- {
- for (j=0; j<good.size; j++)
- {
- if (str[i] == good[j])
- {
- count++;
- break;
- }
- }
- }
- return count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement