home *** CD-ROM | disk | FTP | other *** search
/ Commodore Disk User Volume 3 #8 / Commodore_Disk_User_Vol.3_8_1990_-.d64 / p2 / p2.a7ae (.txt)
Encoding:
Commodore BASIC  |  1990-01-01  |  4.4 KB  |  135 lines

  1. 5 clr
  2. 10 rem ********************************
  3. 20 rem * adventure writing on the c64 *
  4. 30 rem *                              *
  5. 40 rem *    written by jason finch    *
  6. 50 rem *         (c) cdu 1990         *
  7. 60 rem ********************************
  8. 70 :
  9. 80 my=28:rem ** text window size (vert)
  10. 90 :
  11. 95 cd$="":ifmy>14thenmy=14:rem ** max my is 14
  12. 100 poke53280,14:poke53281,6:print"[147][159][197]nter the text that you want to compress"
  13. 105 print"[213]se the standard cursor keys and the    left arrow to mark the end"
  14. 110 print"[196][197][204] cannot be used but press [210][197][212][213][210][206]     to begin compression"
  15. 115 print"[158][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]"right$(cd$,my-1)
  16. 120 print"[192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192]":x=0:y=0
  17. 125 rem *******************************
  18. 130 rem * routine to enter text using *
  19. 135 rem * a fairly simple method      *
  20. 140 rem *                             *
  21. 145 rem * alter line 225 to allow     *
  22. 150 rem * other characters.           *
  23. 155 rem *******************************
  24. 160 poke1344+x+y*40,peek(1344+x+y*40)+128:poke55616+x+y*40,1
  25. 165 geta$:ifa$=""then165
  26. 170 poke1344+x+y*40,peek(1344+x+y*40)-128:ifa$="[145]"theny=y+1*(y>0):goto160
  27. 175 ifa$=""theny=y-1*(y<(my-1)):goto160
  28. 180 ifa$="[157]"thenx=x+1*(x>0):goto160
  29. 185 ifa$=""thenx=x-1*(x<39):goto160
  30. 190 a=asc(a$):ifa=13thenprintcd$"[208]lease wait";:goto270: rem ** return key pressed
  31. 195 if(a>64anda<91)ora=95thena=a-64:goto255:rem *** lower letters/_ ***
  32. 200 ifa>192anda<219thena=a-128:goto255: rem  *** upper letters ***
  33. 205 :
  34. 210 :
  35. 215 rem spc   .     ,     !     ?     "
  36. 220 :
  37. 225 [139]a[178]32[176]a[178]46[176]a[178]44[176]a[178]33[176]a[178]63[176]a[178]34[176]a[178]42[176]a[178]45[176](a[177]47[175]a[179]58)[167]255
  38. 230 :
  39. 235 [143] *  -     0-9
  40. 240 :
  41. 245 :
  42. 250 [137]160
  43. 255 [151]1344[170]x[170]y[172]40,a:x[178]x[170]1:[139]x[178]40[167]x[178]0:y[178]y[170]1
  44. 260 [139]y[178]my[167]y[178]my[171]1:x[178]39
  45. 265 [137]160
  46. 270 e[178]0:[129]i[178]0[164]my[172]40[171]1:[139][194](1344[170]i)[178]31[167]e[178]i:i[178]my[172]40:[143]  ** find marker **
  47. 275 [130]:[139]e[167]290
  48. 280 [153]cd$"(NULL)o end marker - (NULL)ress any key":[151]198,0:[146]198,1
  49. 285 [151]198,0:[153]cd$"                             ":[137]160
  50. 290 [129]i[178]e[164]my[172]40[171]1:[151]1344[170]i,32:[130]:[153]", lenompressing...on"
  51. 295 [143] *******************************
  52. 300 [143] * begin compression and       *
  53. 305 [143] * special coding of the non-  *
  54. 310 [143] * standard characters like    *
  55. 315 [143] * upper-case letters          *
  56. 320 [143] *******************************
  57. 325 l[178]0:cl[178]0
  58. 330 [139](e[171]l)[177][171]1[167][153],,,e[171]l"cmd on"
  59. 335 [129]i[178]0[164]2:a[178][194](1344[170]l[170]i):[139]a[177]0[175]a[179]27[167]375
  60. 340 [139]a[178]32[167]a[178]0:[137]375:[143]  ** space
  61. 345 [139]a[178]46[167]a[178]27:[137]375:[143] ** stop
  62. 350 [139]a[178]44[167]a[178]28:[137]375:[143] ** comma
  63. 355 [139]a[178]63[167]a[178]29:[137]375:[143] ** ?
  64. 360 [139]a[178]33[167]a[178]30:[137]375:[143] ** !
  65. 365 [139]a[177]64[175]a[179]91[167]a[178]a[170]128:[143] ** upper-case letters **
  66. 370 a[178][171]a:[143] ** special non-standard character **
  67. 375 c(i)[178]a:[130]
  68. 380 [129]i[178]0[164]2:c$(i)[178][196](c(i)):[139]c(i)[179]0[167]c$(i)[178]"31:"[170][196]([182](c(i)))
  69. 385 :
  70. 390 c(i)[178][197](c$(i)):[130]: [143] ** add special character if necessary **
  71. 395 :
  72. 400 ex[178]0:[139]c(0)[178]31[167]l[178]l[170]1:c1[178]255:c2[178][197]([202](c$(0),4)):[137]495
  73. 405 :
  74. 410 [139]c(1)[179][177]31[167]430: [143] ** if 2nd in sequence is non-standard, do line 420
  75. 415 :
  76. 420 [151]49152[170]cl[170]2,255:l[178]l[171]1:[151]49152[170]cl[170]3,[197]([202](c$(1),4)):ex[178]2:[137]480
  77. 425 :
  78. 430 [139]c(2)[179][177]31[167]480: [143] ** no non-standard characters
  79. 435 :
  80. 440 [151]49152[170]cl[170]2,255:[151]49152[170]cl[170]3,[197]([202](c$(2),4)):ex[178]2
  81. 445 :
  82. 450 :
  83. 455 [143] *******************************
  84. 460 [143] * line to compress most text  *
  85. 465 [143] *******************************
  86. 470 :
  87. 475 :
  88. 480 c1[178]c(0)[172]4[170](c(1)[175]24)[173]8:c2[178](c(1)[175]7)[172]32[170]c(2):l[178]l[170]3
  89. 485 :
  90. 490 :
  91. 495 [151]49152[170]cl,c1:[151]49152[170]cl[170]1,c2:cl[178]cl[170]2[170]ex:[139]l[179]([181]((e[170]2.5)[173]3)[172]3)[167]330
  92. 500 [143] *******************************
  93. 505 [143] * compression complete -      *
  94. 510 [143] * display information         *
  95. 515 [143] *******************************
  96. 520 [153]"loadlenompression of text complete."
  97. 525 [153]"(NULL)riginal length.... "e:[153]"lenompressed length.. "cl
  98. 530 [153]"(NULL)ercentage saving.. "[181](((e[171]cl)[173]e)[172]10000)[173]100"%"
  99. 535 [153]"lenoded info stored 49152 to"49151[170]cl"incl.":[153]"str$ecompressed text:"
  100. 540 [143] *******************************
  101. 545 [143] * decompress coded characters *
  102. 550 [143] * at location 49152           *
  103. 555 [143] *******************************
  104. 560 [129]z[178]0[164]cl[171]1[169]2  :c1[178][194](49152[170]z):c2[178][194](49153[170]z)
  105. 565 [139]c1[178]255[167][153][199](c2);:[137]675: [143] ** non-standard character **
  106. 570 :
  107. 575 :
  108. 580 [143] *******************************
  109. 585 [143] * line to decompress text     *
  110. 590 [143] *******************************
  111. 595 :
  112. 600 :
  113. 605 c(0)[178][181](c1[173]4):c(1)[178]((c1[175]3)[172]8)[170]((c2[175]224)[173]32):c(2)[178]c2[175]31
  114. 610 :
  115. 615 :
  116. 620 [129]i[178]0[164]2:c[178]c(i):[139]c[177]0[175]c[179]27[167]c(i)[178]c(i)[170]64:[137]660:[143] ** letters **
  117. 625 [139]c[178]0[167]c(i)[178]32:[137]660:[143] * space
  118. 630 [139]c[178]27[167]c(i)[178]46:[137]660:[143]*  stop
  119. 635 [139]c[178]28[167]c(i)[178]44:[137]660:[143]* comma
  120. 640 [139]c[178]29[167]c(i)[178]63:[137]660:[143]*     ?
  121. 645 [139]c[178]30[167]c(i)[178]33:[137]660:[143]*     !
  122. 650 i[178]3:[137]670:[143] * forced end because byte '31' is reached *
  123. 655 :
  124. 660 [153][199](c(i));:[143] ** print decoded character **
  125. 665 :
  126. 670 [130]i
  127. 675 [130]z
  128. 680 [143] *******************************
  129. 685 [143] * end message                 *
  130. 690 [143] *******************************
  131. 695 [153]:[153]"(NULL)ry another example? [(NULL)/(NULL)]":[151]198,0
  132. 700 [161]a$:[139]a$[178]"y"[167][138]
  133. 705 [139]a$[179][177]"n"[167]700
  134. 710 [153]"loadreturn";:[128]
  135.