home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 67 / 067.d81 / bytes (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  122 lines

  1. 10 poke53281,0:poke53280,0:print"[147][159]"
  2. 20 dimo$(19),twenty$(9),hundred$(9),millins$(69),a$(2)
  3. 30 a$(1)="ten ":a$(2)="hundred "
  4. 40 fori=0to19:reado$(i):next
  5. 50 fori=2to9:readtwenty$(i):next
  6. 60 fori=1to9:hundred$(i)=o$(i)+" hundred":next
  7. 70 fori=3to66step3:readmillin$(i):forii=1to2:mi$(i+ii)=a$(ii)+mi$(i):next:next
  8. 80 mi$(1)="ten":mi$(2)="hundred"
  9. 90 gosub930:poke198,0:wait198,1:geta$:ifa$="q"then1160
  10. 100 print"[147][159] [185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185][185]"
  11. 110 print"[154]    [212][200][197][160][205][201][199][200][212][217][160][206][213][205][194][197][210][160][212][210][193][206][211][204][193][212][207][210]    "
  12. 120 print" [184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184][184]"
  13. 125 printspc(10)"[159]by [202]effrey [204]. [202]ones[155]"
  14. 130 print:print"  [206]umber? ";:gosub630:print:print:l=len(nu$):ifnu$=""thenrun
  15. 140 ifmid$(nu$,1,1)="0"thengosub470
  16. 150 gosub580:ps=0
  17. 160 cr$=chr$(13):max=39:dv=3:close4:open4,4,7:close4:ifst=0thenmax=65:dv=4
  18. 170 close3:open3,dv,7:ifdv=4thencr$=cr$+"     ":print#3,cr$cr$cr$;
  19. 180 print#3,pn$" is:"cr$cr$;
  20. 190 onlgosub220,220,280:ifl<4thengosub410:print#3,cr$cr$;:gosub1140:goto100
  21. 200 gosub320:gosub410:print#3,cr$cr$;:gosub1140:goto100
  22. 210 rem translate number <20
  23. 220 ifval(nu$)<20thena$=o$(val(nu$))+" ":gosub550:print#3,a$;:return
  24. 230 rem translate number 20-99
  25. 240 a$=twenty$(val(mid$(nu$,1,1))):ifmid$(nu$,2)<>"0"thena$=a$+"-":gosub550
  26. 250 print#3,a$;:ifmid$(nu$,2)="0"thenprint#3," ";:ps=ps+1:return
  27. 260 a$=o$(val(mid$(nu$,2)))+" ":gosub550:print#3,a$;:return
  28. 270 rem translate number 100-999
  29. 280 a$=hu$(val(mid$(nu$,1,1)))+" ":gosub550:print#3,a$;
  30. 290 ifval(mid$(nu$,2))=0thenreturn
  31. 300 nu$=mid$(nu$,2):gosub220:return
  32. 310 rem translate number >1000
  33. 320 l=len(nu$):ifl<4thengosub280:n$="":return
  34. 330 n$=nu$:gosub380:nu$=mid$(nu$,1,p):l=len(nu$)
  35. 340 ifnu$="000"thennu$=mid$(n$,p+1):goto320
  36. 350 onlen(nu$)gosub220,220,280
  37. 360 a$=mi$(len(mid$(n$,p+1)))+" ":gosub550:print#3,a$;:nu$=mid$(n$,p+1):goto320
  38. 370 rem check for prefix
  39. 380 x=len(nu$):fori=1to3:if(x-i)/3=int((x-i)/3)thenp=i
  40. 390 next:return
  41. 400 rem tack on decimal
  42. 410 ifd=0thenreturn
  43. 420 d=0:print#3,"and ";:nu$=d$:dl=len(nu$):l=len(nu$):gosub470:gosub470
  44. 430 onlgosub220,220,280:ifl<4thenprint#3,mi$(dl)"ths":return
  45. 440 gosub320
  46. 450 print#3,mi$(dl)"ths":return
  47. 460 rem check for leading zeroes
  48. 470 f=0
  49. 480 ifnu$="0"orleft$(nu$,2)="0."thenreturn
  50. 490 fori=1tol:l=len(nu$):ifmid$(nu$,i,1)<>"0"thenf=1
  51. 500 iff=0thennu$=mid$(nu$,i+1)
  52. 510 next
  53. 520 l=len(nu$):iff=0then490
  54. 530 return
  55. 540 rem word wrap
  56. 550 ps=ps+len(a$)+1:ifps>maxthenprint#3,cr$;:ps=len(a$)+1
  57. 560 return
  58. 570 rem pretty up the number
  59. 580 ii=-1:pn$="":fori=lto1step-1:ii=ii+1:ifii=3thenpn$=","+pn$:ii=0
  60. 590 pn$=mid$(nu$,i,1)+pn$:next
  61. 600 ifdthenpn$=pn$+"."+d$
  62. 610 return
  63. 620 rem get number
  64. 630 nu$="":d$="":d=0:nz=0
  65. 640 geta$:gosub790:ifa$=""then640
  66. 650 as=asc(a$):if(a$<"0"ora$>"9")anda$<>"."anda$<>"q"andas<>20andas<>13then640
  67. 660 l=len(nu$):ifa$="q"thenrun
  68. 670 ifas=20andlthennu$=left$(nu$,l-1):printchr$(20);:t=0:gosub800:goto640
  69. 680 ifas=20then640
  70. 690 ifas=13thent=-1:gosub800:gosub820:return
  71. 700 ifa$="."andl=0then640
  72. 710 ifl=69andd=0anda$<>"."then640
  73. 720 ifl=140thenas=20:goto670
  74. 730 ifdthenifa$="."then640
  75. 740 iflandnz=0thenifa$="0"then640
  76. 750 ifa$="."thend=l+1
  77. 760 nu$=nu$+a$:print"[146]"a$;:t=0:gosub800
  78. 770 ifa$<>"0"thennz=1
  79. 780 goto640
  80. 790 ifti<15thenreturn
  81. 800 t=nott:poke199,-t:print" [157]";:ti$="000000":return
  82. 810 rem chop off decimal
  83. 820 ifdthend$=mid$(nu$,d+1):d$=left$(d$,66):nu$=left$(nu$,d-1):l=len(nu$)
  84. 830 return
  85. 840 datazero,one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve
  86. 850 datathirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen,twenty
  87. 860 datathirty,forty,fifty,sixty,seventy,eighty,ninety
  88. 870 datathousand,million,billion,trillion
  89. 880 dataquadrillion,quintillion,sextillion,septillion,octillion,nonillion
  90. 890 datadecillion
  91. 900 dataundecillion,duodecillion,tredecillion,quattrodecillion,quindecillion
  92. 910 datasexdecillion,septendecillion,octodecillion,novemdecillion,vigintillion
  93. 920 datasentillion
  94. 930 poke53281,0:poke53280,0:print"[147][158]"
  95. 940 fori=1to11:print"[169][169][169][169][169][169][169][169][169][169][169][169][169][169][169][169][169][169][169][169][155][223][223][223][223][223][223][223][223][223][223][223][223][223][223][223][223][223][223][223][223]";:next
  96. 950 fori=1to11:print"[152][223][223][223][223][223][223][223][223][223][223][223][223][223][223][223][223][223][223][223][223][151][169][169][169][169][169][169][169][169][169][169][169][169][169][169][169][169][169][169][169][169]";:next:print"[158]"
  97. 960 fori=217to242:pokei,peek(i)or128:next:poke214,5
  98. 970 print:fori=1to10:printtab(4)"[221][152]                              [146][158][221]
  99. 980 [130]:[151]214,6:[151]211,4:[158]58732
  100. 990 [153]"ortantantantantantantantantantantantantantantantantantantantantantantantantantantantantantan^"
  101. 1000 [153][163]5)"listnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewnewsys"
  102. 1010 [151]214,16:[151]211,4:[158]58732
  103. 1020 [153]"/tantantantantantantantantantantantantantantantantantantantantantantantantantantantantantanexp"
  104. 1030 [153][163]5)"ononpokefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefrefresys":[151]214,9:[153]
  105. 1040 a$[178]"(NULL)left$valclose(NULL)right$chr$left$(NULL)(NULL) (NULL)(NULL)(NULL)peekval(NULL)close(NULL)(NULL)atn(NULL)(NULL)(NULL)atn(NULL)(NULL)(NULL)":[141]1090
  106. 1050 a$[178]"by mid$eff mid$ones":[141]1090
  107. 1060 a$[178]"(NULL)(NULL)peek(NULL)right$(NULL)left$valstr$close(NULL)(NULL)close(NULL)(NULL)atnstr$(NULL)(NULL)atn(NULL)close#67":[141]1090
  108. 1070 a$[178]"(NULL)ubscriptions 1-800-831-2694":[141]1090
  109. 1080 [151]214,23:[153]:[153][163]8)"  (NULL) (NULL) val (NULL) (NULL) close atn close (NULL) val (NULL)  ":[137]1100
  110. 1090 [153][166]20[171][195](a$)[173]2)"print#"a$:[142]
  111. 1100 a$[178]"openposcmdcont cmd cmdwaitfre":[129]i[178]4[164]35:[151]214,18:[153]"on"[163]i)a$:[130]
  112. 1110 [151]214,19:[153]"on"[163]20)"cont(NULL)cmd(NULL)"
  113. 1120 [153]"onon"[163]5)"len to continue"[163]22)"(NULL) to quit to
  114. 1130 printtab(7)"with program"tab(24)"[204][207][193][196][211][212][193][210]":return
  115. 1140 ifdv=4thenreturn
  116. 1150 print:printtab(11)"[159] [154]  [208][210][197][211][211] [193][160][203][197][217]  [159] ":poke198,0:wait198,1:geta$:return
  117. 1160 a$="hello connect":open15,8,15,"r0:"+a$+"="+a$:input#15,er:close15
  118. 1170 if er<>63 then print"[147]":end
  119. 1180 q$=chr$(34):poke646,peek(53281):print"[147]"
  120. 1190 print"load"q$a$q$",8"
  121. 1200 print"run":poke631,13:poke632,13:poke198,2:end
  122.