home *** CD-ROM | disk | FTP | other *** search
/ Floppy Magazine 1986 #1 / Floppy_Magazine_86-1_1986_Megasystems_Oy_fi.d64 / veikkaus (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  3KB  |  148 lines

  1. 0 rem--- (c) anssi hakkarainen 1986 ---
  2. 1 rem          veikkausrivit
  3. 2 rem
  4. 3 poke251,0:gosub1000
  5. 4 cc=rnd(-ti)
  6. 8 dime(3,13),pe(13),q(14)
  7. 10 poke53280,6:poke53281,6
  8. 11 print"[147]   ****  [214]eikkausrivien arvonta  ****"
  9. 12 print:print"      ([195]) [193]nssi [200]akkarainen 1986"
  10. 15 goto230
  11. 18 rem -- rivien arvonta --
  12. 20 clr:input"[205]ontako saraketta (max 500)";sa$:ifval(sa$)>500orval(sa$)<1then20
  13. 25 sa=val(sa$):dimpr$(sa),l$(sa),o(sa),e(3,13),pe(13),q(14)
  14. 30 print"[211]e maksaa"sa/2"markkaa":m=.99
  15. 40 fori=1to13
  16. 50 print"[203][207][200][196][197]"i
  17. 60 input"[217]kkoselle %  ";y$
  18. 70 input"[210]istille %   ";r$
  19. 80 input"[203]akkoselle % ";k$
  20. 90 y=val(y$):r=val(r$):k=val(k$)
  21. 95 ify+r+k<>100thengosub360:goto50
  22. 100 e(1,i)=y:e(2,i)=r:e(3,i)=k
  23. 110 print"":next
  24. 111 print"[207]dota hetki...."
  25. 120 fori=1tosa
  26. 125 fort=1to13
  27. 130 z=rnd(0)+m
  28. 131 y=e(1,t)/100:r=e(2,t)/100
  29. 140 ifz<y+1andy>0thenpe(t)=1:goto170
  30. 150 ifz<y+r+1andr>0thenpe(t)=2:goto170
  31. 160 pe(t)=3
  32. 170 pe$=str$(pe(t)):pr$(i)=pr$(i)+pe$:next
  33. 171 ifi>1thengosub400
  34. 172 next
  35. 175 fort=1tosa
  36. 180 fori=1to26
  37. 190 ifmid$(pr$(t),i,1)="1"thena$=a$+"1"
  38. 192 ifmid$(pr$(t),i,1)="2"thena$=a$+"x"
  39. 194 ifmid$(pr$(t),i,1)="3"thena$=a$+"2"
  40. 200 next
  41. 210 l$(t)=a$:a$=""
  42. 220 next
  43. 222 gosub300
  44. 225 print"[147]"
  45. 230 print:print:print"1 [210]ivien arvonta"
  46. 235 print"2 [204]ataa rivit"
  47. 240 print"3 [212]alleta rivit"
  48. 250 print"4 [212]arkasta rivit"
  49. 255 print"5 [212]ulosta rivit"
  50. 260 print"6 [204]opetus"
  51. 261 getg$:ifg$=""then261
  52. 265 g=val(g$):p=0
  53. 270 onggoto20,505,450,600,750,285
  54. 280 goto261
  55. 285 end
  56. 300 rem -- aanimerkki --
  57. 305 fori=54272to54296:pokei,0:next
  58. 310 poke54296,15:poke54277,44:poke54278,44:poke54276,33
  59. 320 poke54273,25:poke54272,177:fori=1to100:next
  60. 321 poke54273,45:poke54272,198:fori=1to200:next
  61. 322 poke54273,30:poke54272,141:fori=1to200:next
  62. 340 fori=54272to54296:pokei,0:next
  63. 350 return
  64. 360 forpy=54272to54296:pokepy,0:next
  65. 365 poke54296,15:poke54277,44:poke54278,166:poke54276,33
  66. 370 poke54273,5:poke54272,5:forpy=1to100:next
  67. 380 forpy=54272to54296:pokepy,0:next
  68. 390 return
  69. 400 forj=1toi-1:ifpr$(j)=pr$(i)theni=i-1
  70. 405 next
  71. 410 return
  72. 420 rem -- tiedoston talletus --
  73. 450 input"[212]alletettavan tiedoston nimi";fi$
  74. 460 open1,8,1,fi$+".vk"
  75. 465 print#1,sa$
  76. 470 fori=1tosa
  77. 480 print#1,l$(i)
  78. 481 getg$:ifg$="[136]"thenwait631,199
  79. 490 next
  80. 495 gosub900:goto791
  81. 501 rem -- tiedoston lataus --
  82. 505 clr
  83. 510 input"[204]adattavan tiedoston nimi";fi$
  84. 520 open1,8,0,fi$+".vk"
  85. 530 input#1,sa$
  86. 535 sa=val(sa$):ifsa=0then552
  87. 536 diml$(sa),o(sa),q(14)
  88. 540 fori=1tosa:input#1,l$(i)
  89. 550 next
  90. 552 gosub900:goto791
  91. 590 rem -- rivien tarkastus --
  92. 600 print"[147]         [210]ivien tarkastus"
  93. 605 ifpeek(251)=1theninput"[212]ulostus myos printterille (k/e)  k[157][157][157]";ck$
  94. 606 ifck$="k"thenp=1
  95. 610 input"[211]yota oikea rivi";oi$
  96. 620 iflen(oi$)<>13then610
  97. 621 print"[207]dota hetki...."
  98. 622 print
  99. 630 fort=1tosa
  100. 631 iflen(l$(t))<>13thenq(0)=q(0)-1
  101. 635 fori=1to13
  102. 640 ifmid$(l$(t),i,1)=mid$(oi$,i,1)theno=o+1
  103. 645 next
  104. 650 o(t)=o
  105. 660 o=0:next
  106. 670 fori=1tosa
  107. 675 fort=0to13
  108. 680 ifo(i)=tthenq(t)=q(t)+1
  109. 690 next:next
  110. 695 ifp=1thenopen4,4
  111. 700 fori=13to0step-1
  112. 705 printi
  113. 710 print"[145]oikein"q(i)" kpl"
  114. 711 ifp=1thenprint#4,i" oikein"q(i)" kpl"
  115. 715 q(i)=0
  116. 720 next
  117. 722 ifp=1thenprint#4,chr$(13)chr$(13):close4
  118. 730 print"   paina return   "
  119. 740 getg$:ifg$=chr$(13)then10
  120. 741 goto740
  121. 742 rem -- rivien tulostus --
  122. 750 ifpeek(251)=1theninput"[212]ulostus printterille (k/e)  k[157][157][157]";cx$
  123. 760 ifcx$="k"then800
  124. 770 fori=1tosa
  125. 780 printl$(i)"       ";
  126. 781 getg$:ifg$="[136]"thengosub860
  127. 790 next
  128. 791 print:print"   paina return   "
  129. 792 getg$:ifg$=chr$(13)then10
  130. 795 goto792
  131. 800 open4,4
  132. 810 fori=1tosa
  133. 820 print#4,l$(i)"       ";
  134. 830 next
  135. 840 cmd4
  136. 850 print#4:close4:goto791
  137. 860 getg$:ifg$="[136]"thenreturn
  138. 865 goto860
  139. 895 rem -- levyvirheen tutkiminen --
  140. 900 close1:open15,8,15:input#15,e1$,e2$,e3$,e4$
  141. 905 ife2$="ok"thenprint"ok.":goto920
  142. 910 print""e1$","e2$","e3$;e4$
  143. 920 close15:return
  144. 1000 poke53280,6:poke53281,6
  145. 1010 input"[147][203]aytetaanko printteria (k/e)  k[157][157][157]";ka$
  146. 1020 ifka$="k"thenpoke251,1
  147. 1030 return
  148.