Wed Sep 12 21:11:23 2018 CHRPAK_TEST Python version: 3.6.5 Test the CHRPAK library. CH_CAP_TEST Python version: 3.6.5 CH_CAP uppercases a character. C CH_CAP(C) F F f F 1 1 b B & & CH_CAP_TEST: Normal end of execution. CH_IS_DIGIT_TEST Python version: 3.6.5 CH_IS_DIGIT is TRUE if a character is a decimal digit. 0 "0" True 1 "1" True 2 "2" True 3 "3" True 4 "4" True 5 "5" True 6 "6" True 7 "7" True 8 "8" True 9 "9" True 10 "X" False 11 "?" False 12 " " False CH_IS_DIGIT_TEST: Normal end of execution. CH_IS_ISBN_DIGIT_TEST Python version: 3.6.5 CH_IS_ISBN_DIGIT is TRUE if a character is an ISBN digit. "0" True "1" True "2" True "3" True "4" True "5" True "6" True "7" True "8" True "9" True "X" True "x" True "Y" False "*" False "?" False " " False CH_IS_ISBN_DIGIT_TEST: Normal end of execution. CH_TO_DIGIT_TEST Python version: 3.6.5 CH_TO_DIGIT: character -> decimal digit 0 "0" 0 1 "1" 1 2 "2" 2 3 "3" 3 4 "4" 4 5 "5" 5 6 "6" 6 7 "7" 7 8 "8" 8 9 "9" 9 10 "X" -1 11 "?" -1 12 " " -1 CH_TO_DIGIT_TEST: Normal end of execution. CH_TO_ROT13_TEST Python version: 3.6.5 CH_TO_ROT13 "encodes" characters using ROT13 (and digits using ROT5). A second application of the function returns the original character. CH : ABCDEFGHIJKLMNOPQRSTUVWXYZ ROT13(CH) : NOPQRSTUVWXYZABCDEFGHIJKLM ROT13(ROT13(CH)): ABCDEFGHIJKLMNOPQRSTUVWXYZ CH : CH_TO_ROT13 "encodes" characters using ROT13 ROT13(CH) : PU_GB_EBG68 "rapbqrf" punenpgref hfvat EBG68 ROT13(ROT13(CH)): CH_TO_ROT13 "encodes" characters using ROT13 CH_TO_ROT13_TEST: Normal end of execution. DIGIT_TO_CH_TEST Python version: 3.6.5 DIGIT_TO_CH: decimal digit -> character. -2 "*" -1 -1 "*" -1 0 "0" 0 1 "1" 1 2 "2" 2 3 "3" 3 4 "4" 4 5 "5" 5 6 "6" 6 7 "7" 7 8 "8" 8 9 "9" 9 10 "*" -1 11 "*" -1 DIGIT_TO_CH_TEST: Normal end of execution. I4_LENGTH_TEST Python version: 3.6.5 I4_LENGTH computes an integer's "length". I4 Length 0 1 1 1 -1 2 140 3 -1952 5 123456 6 I4_LENGTH_TEST: Normal end of execution. I4_TO_ISBN_DIGIT_TEST Python version: 3.6.5 I4_TO_ISBN_DIGIT converts digits 0 to 10 to an ISBN digit. 0 "0" 1 "1" 2 "2" 3 "3" 4 "4" 5 "5" 6 "6" 7 "7" 8 "8" 9 "9" 10 "X" I4_TO_ISBN_DIGIT_TEST: Normal end of execution. I4_UNIFORM_AB_TEST Python version: 3.6.5 I4_UNIFORM_AB computes pseudorandom values in an interval [A,B]. The lower endpoint A = -100 The upper endpoint B = 200 The initial seed is 123456789 1 -35 2 187 3 149 4 69 5 25 6 -81 7 -23 8 -67 9 -87 10 90 11 -82 12 35 13 20 14 127 15 139 16 -100 17 170 18 5 19 -72 20 -96 I4_UNIFORM_AB_TEST: Normal end of execution. I4VEC_PRINT_TEST Python version: 3.6.5 I4VEC_PRINT prints an I4VEC. Here is an I4VEC: 0 91 1 92 2 93 3 94 I4VEC_PRINT_TEST: Normal end of execution. ISBN_DIGIT_TO_I4_TEST Python version: 3.6.5 ISBN_DIGIT_TO_I4 converts an ISBN digit to an I4 "0" 0 "1" 1 "2" 2 "3" 3 "4" 4 "5" 5 "6" 6 "7" 7 "8" 8 "9" 9 "X" 10 "x" 10 "Y" -1 "*" -1 "?" -1 " " -1 ISBN_DIGIT_TO_I4_TEST: Normal end of execution. RAT_TO_S_TEST Python version: 3.6.5 RAT_TO_S converts a rational to a string. A B A/B 3 4 3/4 1 1000 1/1000 20 1 20/1 8 4 8/4 -10 7 -10/7 9 -15 9/-15 -11 -11 -11/-11 RAT_TO_S_TEST: Normal end of execution. S_DIGITS_COUNT_TEST Python version: 3.6.5 S_DIGITS_COUNT counts the digits in a string. We count 7 digits in "34E94-70.6" We count 0 digits in "Not a one!" We count 3 digits in "#8*k >>>> & SEVEN-0.3" S_DIGITS_COUNT_TEST Normal end of execution. S_LEN_TRIM_TEST Python version: 3.6.5 S_LEN_TRIM returns the length of string to the last nonblank. LEN S_LEN_TRIM ---------S--------- 8 8 "Hi, Bob!" 23 18 " How are you? " 4 0 " " S_LEN_TRIM_TEST Normal end of execution. S_QUOTE_TEST Python version: 3.6.5 S_QUOTE quotes a string S1 with a mark MARK. ----S1---- ---MARK--- ----S2---- Hi, Bob! " "Hi, Bob!" De Loop LoopDeLoop S_QUOTE_TEST Normal end of execution. S_TO_CAESAR_TEST Python version: 3.6.5 S_TO_CAESAR applies a Caesar shift cipher to a string. S2 = S_TO_CAESAR ( S1, K ), varying K. K ---------------S1---------------- ---------------S2---------------- -5 "A man, a plan, a canal: Panama!" "V hvi, v kgvi, v xvivg: Kvivhv!" -4 "A man, a plan, a canal: Panama!" "W iwj, w lhwj, w ywjwh: Lwjwiw!" -3 "A man, a plan, a canal: Panama!" "X jxk, x mixk, x zxkxi: Mxkxjx!" -2 "A man, a plan, a canal: Panama!" "Y kyl, y njyl, y aylyj: Nylyky!" -1 "A man, a plan, a canal: Panama!" "Z lzm, z okzm, z bzmzk: Ozmzlz!" 0 "A man, a plan, a canal: Panama!" "A man, a plan, a canal: Panama!" 1 "A man, a plan, a canal: Panama!" "B nbo, b qmbo, b dbobm: Qbobnb!" 2 "A man, a plan, a canal: Panama!" "C ocp, c rncp, c ecpcn: Rcpcoc!" 3 "A man, a plan, a canal: Panama!" "D pdq, d sodq, d fdqdo: Sdqdpd!" 4 "A man, a plan, a canal: Panama!" "E qer, e tper, e gerep: Tereqe!" 5 "A man, a plan, a canal: Panama!" "F rfs, f uqfs, f hfsfq: Ufsfrf!" S2 = S_TO_CAESAR ( S1, K ). S3 = S_TO_CAESAR ( S2, -K ) K ------------S1------------ ------------S2------------ ------------S3------------ -5 "The key is under the mat" "Ocz fzt dn piyzm ocz hvo" "The key is under the mat" -4 "The key is under the mat" "Pda gau eo qjzan pda iwp" "The key is under the mat" -3 "The key is under the mat" "Qeb hbv fp rkabo qeb jxq" "The key is under the mat" -2 "The key is under the mat" "Rfc icw gq slbcp rfc kyr" "The key is under the mat" -1 "The key is under the mat" "Sgd jdx hr tmcdq sgd lzs" "The key is under the mat" 0 "The key is under the mat" "The key is under the mat" "The key is under the mat" 1 "The key is under the mat" "Uif lfz jt voefs uif nbu" "The key is under the mat" 2 "The key is under the mat" "Vjg mga ku wpfgt vjg ocv" "The key is under the mat" 3 "The key is under the mat" "Wkh nhb lv xqghu wkh pdw" "The key is under the mat" 4 "The key is under the mat" "Xli oic mw yrhiv xli qex" "The key is under the mat" 5 "The key is under the mat" "Ymj pjd nx zsijw ymj rfy" "The key is under the mat" S_TO_CAESAR_TEST: Normal end of execution. S_TO_DIGITS_TEST Python version: 3.6.5 S_TO_DIGITS: string -> digit vector Test string: "34E94-70.6" Extracted 5 digits: 0 3 1 4 2 9 3 4 4 7 Test string: "34E94-70.6" Extracted 7 digits: 0 3 1 4 2 9 3 4 4 7 5 0 6 6 S_TO_DIGITS_TEST Normal end of execution. S_TO_ISBN_DIGITS_TEST Python version: 3.6.5 S_TO_ISBN_DIGITS: string -> ISBN digit vector Test string: "34E9X-70.6" Extracted 5 digits: 0 3 1 4 2 9 3 10 4 7 Test string: "34E9X-70.6" Extracted 7 digits: 0 3 1 4 2 9 3 10 4 7 5 0 6 6 S_TO_ISBN_DIGITS_TEST Normal end of execution. S_TO_ROT13_TEST Python version: 3.6.5 S_TO_ROT13 applies the ROT13 cipher to a string. S2 = S_TO_ROT13 ( S1 ). -------------------S1------------------- -------------------S2------------------- "abcdefghijklmnopqrstuvwxyz" "nopqrstuvwxyzabcdefghijklm" "Cher" "Pure" "James Thurston Howell III" "Wnzrf Guhefgba Ubjryy VVV" "The bill is $1,205,837.49 so pay now!" "Gur ovyy vf $6,750,382.94 fb cnl abj!" S2 = S_TO_ROT13 ( S1 ). S3 = S_TO_ROT13 ( S2 ). -------------------S1------------------- -------------------S3------------------- "abcdefghijklmnopqrstuvwxyz" "abcdefghijklmnopqrstuvwxyz" "Cher" "Cher" "James Thurston Howell III" "James Thurston Howell III" "The bill is $1,205,837.49 so pay now!" "The bill is $1,205,837.49 so pay now!" S_TO_ROT13_TEST: Normal end of execution. CHRPAK_TEST: Normal end of execution. Wed Sep 12 21:11:23 2018