home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1994 May / 1994-05b.d64 / convert (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  848b  |  22 lines

  1. 670 def fn p1(x)=x+128+128*(x>31)+64*(x>63)-32*(x>95)-96*(x>127)+128*(x>159)
  2. 675 def fn ps(x)=fn p1(x)+64*(x>191)+33*(x>254)
  3. 680 def fn sp(x)=x+64+64*(x>31)-128*(x>63)+64*(x>95)+192*(x>127)-64*(x>191)
  4. 685 def fn a1(x)=x+(x*(x>127))-126*(x>127)
  5. 690 def fn a2(x)=x-32*(x>64 and x<91)+32*(x>96 and x<123)+128*(x>192 and x<219)
  6. 695 def fn cv(x)=fn a1(fn a2(x))
  7. 698 rem"[192][192][192][192][192][192][192]chop here[192][192][192][192][192]
  8. 700 [153]"loadstop*** input file ***":[141]900:[159]2,8,2,x$[170]","[170]y$[170]",r":f[178]x
  9. 710 [153]"*** output file ***":[141]900:[159]3,8,3,x$[170]","[170]y$[170]",w":t[178]x
  10. 720 [161]#2,x$:x[178][198](x$[170][199](0)):[139] st [175] 64 [167]790
  11. 730 [139]f[178]1[175]t[178]2[167]x[178][165] cv(x)
  12. 735 [139]f[178]1[175]t[178]3[167]x[178][165] ps(x)
  13. 740 [139]f[178]2[175]t[178]1[167]x[178][165] cv(x)
  14. 750 [139]f[178]2[175]t[178]3[167]x[178][165] ps([165] cv(x))
  15. 760 [139]f[178]3[175]t[178]1[167]x[178][165] sp(x)
  16. 770 [139]f[178]3[175]t[178]2[167]x[178][165] cv([165] sp(x))
  17. 780 [152]3,[199](x);:[153]".";:[137]720
  18. 790 [160]2:[160]3:[153]"done":[128]
  19. 900 [133]"filename";x$:[133]"file type: seq, prg, usr (s,p,u)";y$
  20. 910 [153]"file contents:":[153]"1-pet ascii 2-true ascii 3-screen pokes"
  21. 920 [133]x:[142]
  22.