// The "Needs to be written." functions are due to the fact that new // Ruby versions written way back were never converted by the converter // [actually written by Innosphere]. // Most likely the conversion of the 'old' Ruby versions are in // the CodeBlock.xml, but I want to look these over and will write // JS versions soon [for the same reason why the old Ruby versions // were rewitten in the first place]. // // amap_1(): // // The characters 'A'-'Z' are mapped to numbers 10-35. // The characters '0'-'9' are mapped to numbers 0-9. // An ampersand character ['&'] is mapped to number 36. // // Any other character is mapped to 0. // // Result is an integer. // // UserMethod HashCode: 7624BD0617616961507F7C1FA851778C function amap_1(a) { if (a == "&") { return 36; } else if (a >= "0" && a <= "9") { return a.to_i(); } else if (a >= "A" && a <= "Z") { return a.charCodeAt(0) - 55; } else { return 0; } } // // amap_2(): // // The characters 'A'-'Z' are mapped to the strings '01'-'26'. // A comma character [','] is mapped to string '27'. // A hyphen character ['-'] is mapped to string '28'. // An apostrophe character ['''] is mapped to string '29'. // // Any other character is mapped to string '00'. // // Result is a string. // // UserMethod HashCode: 21ABC1720E65096E57E95BC6C80049B0 function amap_2(a) { if (a == ",") { return "27"; } else if (a == "-") { return "28"; } else if (a == "'") { return "29"; } else if (a >= "A" && a <= "Z") { return (a.charCodeAt(0) - 64).to_i().fixed(0); } else { return "00"; } } // // amap_3(): // // The characters 'A'-'Z' are mapped to the strings '01'-'26'. // // Any other character is mapped to string '00'. // // Result is a string. // // UserMethod HashCode: 8D6D4C38B1495131D77A63C929811085 function amap_3(a) { if (a >= "A" && a <= "Z") { return (a.charCodeAt(0) - 64).to_i().complexFixedString(0, '02'); } else { return (0).to_i().complexFixedString(0, '02'); } } // // amap_4(): // // The characters 'A'-'Z' are mapped to the strings '01'-'26'. // The characters '0'-'9' are mapped to the strings '30'-'39'. // // Any other character is mapped to string '00'. // // Result is a string. // // UserMethod HashCode: 87E32C453B2FA9CA423D44A1B56FD610 function amap_4(a) { if (a >= "0" && a <= "9") { return (a.charCodeAt(0) - 18).toString(); } else if (a >= "A" && a <= "Z") { return (a.charCodeAt(0) - 64).to_i().fixed(0); } else { return "00"; } } // The characters 'A'-'Z' are mapped to numbers 65-90. // The characters '0'-'9' are mapped to numbers 48-57. // An ampersand character ['&'] is mapped to number 38. // A space character [' '] is mapped to number 32. // A hyphen character ['-'] is mapped to number 45. // // Any other character is mapped to 0. // // Result is an integer. // // UserMethod missing HasCode:[0D873BC7F87A0D659E21E770E2F30EF9] // // //amap_5(): Needs to be written. function amap_5(a) { if (a == "-") { return 45; } else if (a == " ") { return 32; } else if (a == "&") { return 38; } else if (a >= "0" && a <= "9") { return a.charCodeAt(0); } else if (a >= "A" && a <= "Z") { return a.charCodeAt(0); } else { return 0; } } // // amap_6(): // // The characters 'A'-'I' and 'J'-'R' are mapped to numbers 1-9. // The characters 'S'-'Z' are mapped to numbers 2-9. // The characters '0'-'9' are mapped to numbers 0-9. // // Any other character is mapped to 0. // // Result is an integer. // // UserMethod HashCode: 1BF92C65160C45A630CCB987990CA7B7 function amap_6(a) { var defaultResult = 0; var firstLetter = a.charAt(0); if (typeof a !== "string") { return defaultResult; } var firstLetterCode = a.charCodeAt(0); if (/[0-9]/.test(firstLetter)) { return firstLetter.to_i(); } if (/[A-I]/.test(firstLetter)) { return firstLetterCode - 64; } if (/[J-R]/.test(firstLetter)) { return firstLetterCode - 73; } if (/[S-Z]/.test(firstLetter)) { return firstLetterCode - 81; } return defaultResult; } // // amap_7(): Needs to be written. // // The characters 'A'-'Z' are mapped to strings '10'-'35'. // The characters '0'-'9' are mapped to the two-digit strings '00'-'09'. // An ampersand character ['&'] is mapped to string '36'. // // Any other character is mapped to string '00'. // // Result is a string. // // UserMethod missing HasCode:[0D580C0797EF11354A9129B7D9BFEC60] // // // amap_8(): // // The characters 'A'-'Z' are mapped to numbers 10-35. // The characters '0'-'9' are mapped to numbers 0-9. // An ampersand character ['&'] is mapped to number 36. // // Any other character is mapped to number 37. // // Result is an integer. // // UserMethod HashCode: 8BE473430410F64FCA2F7FC30A82CB4C function amap_8(a) { var defaultResult = 37; var firstLetter = a.charAt(0); if (typeof a !== "string") { return defaultResult; } var firstLetterCode = a.charCodeAt(0); if (firstLetter === '&') { return 36; } if (/[0-9]/.test(firstLetter)) { return firstLetter.to_i(); } if (/[A-Z]/.test(firstLetter)) { return firstLetterCode - 55; } return defaultResult; } // // amap_9(): Needs to be written. // // The characters 'A'-'I' and 'K'-'S' are mapped to numbers 1-9. // The characters 'U'-'Z' are mapped to numbers 1-6. // The characters '0'-'9' are mapped to numbers 0-9. // // Any other character is mapped to 0. // // Result is an integer. // // UserMethod missing HasCode:[4ABF2AAB9D53A48CF8C81CFAE3907EF1] // // // amap_10(): Needs to be written. // // The characters 'A'-'Z' are mapped to numbers 10-35. // The characters '0'-'9' are mapped to numbers 0-9. // An ampersand character ['&'] is mapped to number 36. // A space character [' '] is mapped to 0. // // Any other character is mapped to number 37. // // Result is an integer. // // UserMethod missing HasCode:[D4BF505A498B409F3C06C2E169808A0D] // // // delaware_amap(): // // A '0' character is mapped to the number 10. // The characters '1'-'9' are mapped to numbers 1-9. // The characters 'A'-'H' are mapped to numbers 11-18. // The characters 'J'-'N' are mapped to numbers 19-23. // The characters 'P'-'R' are mapped to numbers 24-26. // The characters 'T'-'U' are mapped to numbers 27-28. // The characters 'W'-'Y' are mapped to numbers 29-31. // // Any other character is mapped to 0. // // Result is an integer. // // UserMethod HashCode: 690F5373EDA646F3DFC5AF08972DEDE0 function delaware_amap(a) { if (a == '0') { return 10; } else if (a >= '1' && a <= '9') { return parseInt(a); } else if (a >= 'A' && a <= 'H') { return (a.charCodeAt(0) - 54); } else if (a >= 'J' && a <= 'N') { return (a.charCodeAt(0) - 55); } else if (a >= 'P' && a <= 'R') { return (a.charCodeAt(0) - 56); } else if (a >= 'T' && a <= 'U') { return (a.charCodeAt(0) - 57); } else if (a >= 'W' && a <= 'Y') { return (a.charCodeAt(0) - 58); } else { return 0; } } // // delaware_cd(): // // This is the reverse of the delaware_amap( ) method. For example, delaware_amap( ) // converts an 'A' to the number 11, this routine will revert the number 11 back to the // letter 'A'. // // The number 10 is mapped to character '0'. // The numbers 1-9 are mapped to characters '1'-'9'. // The numbers 11-18 are mapped to characters 'A'-'H'. // The numbers 19-23 are mapped to characters 'J'-'N'. // The numbers 24-26 are mapped to characters 'P'-'R'. // The numbers 27-28 are mapped to characters 'T'-'U'. // The numbers 29-31 are mapped to characters 'W'-'Y'. // // Any other number is mapped to the character '0'. // // Result is a string. // // UserMethod HashCode: 55D3AF652182BD1456E76741196E3032 function delaware_cd(a) { if (a >= 1 && a <= 9) { return String.fromCharCode(a + 48); } else if (a >= 11 && a <= 18) { return String.fromCharCode(a + 54); } else if (a >= 19 && a <= 23) { return String.fromCharCode(a + 55); } else if (a >= 24 && a <= 26) { return String.fromCharCode(a + 56); } else if (a >= 27 && a <= 28) { return String.fromCharCode(a + 57); } else if (a >= 29 && a <= 31) { return String.fromCharCode(a + 58); } else { return String.fromCharCode(48); } } // // fed_amap(): Needs to be written. // // The characters 'A'-'Z' are mapped to numbers 10 - 35. // The characters '0'-'9' are mapped to numbers 0-9. // A hyphen character ['-'] is mapped to number 36. // A period character ['.'] is mapped to number 37. // A space character [' '] is mapped to number 38. // A dollar sign character ['$'] is mapped to number 39. // A slash character ['/'] is mapped to number 40. // A plus sign character ['+'] is mapped to number 41. // A percent sign character ['%'] is mapped to number 42. // // Any other character is mapped to 0. // // Result is an integer. // // UserMethod missing HasCode:[93A807C0F00BBD7622236969E2F9A1C6] // // // fed5500_cd(): Needs to be written. // // This is the reverse of the fed_amap( ) method. For example, fed_amap( ) converts an 'A' to // the number 10, this routine will revert the number 10 back to the letter 'A'. // // The numbers 10 - 35 are mapped to characters 'A'-'Z'. // The numbers 0-9 are mapped to characters '0'-'9'. // The number 36 is mapped to the hyphen character ['-']. // The number 37 is mapped to the period character ['.']. // The number 38 is mapped to the space character [' ']. // The number 39 is mapped to the dollar sign character ['$']. // The number 40 is mapped to the slash character ['/']. // The number 41 is mapped to the plus sign character ['+']. // The number 42 is mapped to the percent sign character ['%']. // // Any other number is mapped to the character '0'. // // Result is a string. // // UserMethod missing HasCode:[29989D9E5C8AC5BFCB3E31224D79387B] // // // utah_amap(): Needs to be written. // // The characters 'A'-'Z' are mapped to numbers 1-26. // The characters '0'-'9' are mapped to numbers 0-9. // // Any other character is mapped to 0. // // Result is an integer. // // NOTE: This routine seems wierd in that some characters get // mapped to the same value [not talking about the default value of zero]. // // UserMethod missing HasCode:[F7505EBF18C62A323C3EA8D6EC9C9B95] //