home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 14 / 014.d81 / algebra (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  24KB  |  938 lines

  1. 4 rem:   ...........................
  2. 5 rem:   :       algebra           :
  3. 6 rem:   :m.a.c.e. software contest:
  4. 7 rem:   :    john robinson        :
  5. 8 rem:   :        1984             :
  6. 9 rem:   :.........................:
  7. 10 goto13000
  8. 50 print"[147]":poke53281,0:poke53280,0
  9. 60 fory=1to18
  10. 61 readz
  11. 62 poke1033+y,z:poke55305+y,2
  12. 63 next
  13. 70 fory=1to18
  14. 71 readz
  15. 72 poke1993+y,z:poke56265+y,2
  16. 73 next
  17. 95 rem:define variables
  18. 100 a=int(18*rnd(1))-9
  19. 110 b=int(18*rnd(1))-9
  20. 120 ifb=0thenb=1
  21. 130 c=int(18*rnd(1))-9
  22. 140 d=int(20*rnd(1))-10
  23. 150 ifd=0thend=1
  24. 160 e=int(20*rnd(1))-10
  25. 170 f=int(20*rnd(1))-10
  26. 180 a1=int(18*rnd(1))-9
  27. 190 b1=int(18*rnd(1))-9
  28. 200 ifb1=0thenb1=1
  29. 210 c1=int(18*rnd(1))-9
  30. 220 d1=int(20*rnd(1))-10
  31. 230 ifd1=0thend1=1
  32. 233 ifa=0then100
  33. 234 ifa1=0then100
  34. 235 n1=d*d1*f
  35. 240 n2=a*d1*c
  36. 250 n3=a1*d*c1
  37. 260 n4=d*d1*e
  38. 270 n5=a*d1*b
  39. 280 n6=a1*d*b1
  40. 290 m1=n1-n2-n3-n4
  41. 300 m2=n5+n6
  42. 310 ifm2=0then100
  43. 320 x=m1/m2
  44. 330 ifx=int(x)then336
  45. 335 goto100
  46. 336 ifx>99orx<-99then100
  47. 337 ifx=0then100
  48. 338 goto6000
  49. 339 ti$="000000"
  50. 340 print"[147]":goto8500
  51. 341 gosub7000
  52. 345 ifa=0then650
  53. 350 ifa=1then400
  54. 360 ifb=1then550
  55. 370 ifc=0then580
  56. 380 ifd=1then600
  57. 390 ifb=-1then393
  58. 391 ifc<0then395
  59. 392 t=9-l1-l2-l3:printtab(t-(-t*(t<1)))a"[157]("b"[157][154]x+"c"[157])":goto397
  60. 393 ifc<0then396
  61. 394 t=8-l1-l2:printtab(t-(-t*(t<1)))a"[157](-[154]x+"c"[157])":goto397
  62. 395 t=10-l1-l2-l3:printtab(t-(-t*(t<1)))a"[157]("b"[157][154]x"c"[157])":goto397
  63. 396 t=9-l1-l3:printtab(t-(-t*(t<1)))a"[157](-[154]x"c"[157])":goto397
  64. 397 printtab(t-(-t*(t<1)))"[192][192][192][192][192][192][192][192][192][192][192][192][192]"
  65. 398 printtab(t-(-t*(t<1)))"   "d:goto650
  66. 400 ifb=1then440
  67. 410 ifc=0then470
  68. 420 ifd=1then490
  69. 430 ifb=-1then433
  70. 431 ifc<0then435
  71. 432 t=11-l2-l3:printtab(t-(-t*(t<1)))b"[157][154]x+"c:goto437
  72. 433 ifc<0then436
  73. 434 t=11-l3:printtab(t-(-t*(t<1)))"-[154]x+"c:goto437
  74. 435 t=12-l2-l3:printtab(t-(-t*(t<1)))b"[157][154]x"c:goto437
  75. 436 t=11-l3:printtab(t-(-t*(t<1)))"-[154]x"c
  76. 437 printtab(t-(-t*(t<1)))"[192][192][192][192][192][192][192][192][192][192][192][192][192]"
  77. 438 printtab(t+2)d:goto650
  78. 440 ifc=0then500
  79. 450 ifd=1then520
  80. 460 ifc<0then467
  81. 464 t=11-l3:printtab(t-(-t*(t<1)))"[154]x+"c"
  82. 465 [153][163]t[171]([171]t[172](t[179]1)))"tantantantantantantantantan"
  83. 466 [153][163]t[170]1)d:[137]650
  84. 467 t[178]12[171]l3:[153][163]t[171]([171]t[172](t[179]1)))"contx"c:[137]465
  85. 470 [139]d[178]1[167]530
  86. 480 t[178]12[171]l2:[153][163]t[171]([171]t[172](t[179]1)))b"cmdcontx"
  87. 481 [153][163]t[171]([171]t[172](t[179]1)))"tantantantantantan"
  88. 482 [153][163]t[170]1)d:[137]650
  89. 490 [139]b[178][171]1[167]493
  90. 491 [139]c[179]0[167]495
  91. 492 t[178]12[171]l2[171]l3:[153][163]t[171]([171]t[172](t[179]1)))""b"cmdcontx+"c"":[137]650
  92. 493 [139]c[179]0[167]496
  93. 494 t[178]11[171]l3:[153][163]t[171]([171]t[172](t[179]1)))"-contx+"c"":[137]650
  94. 495 t[178]13[171]l2[171]l3:[153][163]t[171]([171]t[172](t[179]1)))""b"cmdcontx"c"":[137]650
  95. 496 t[178]12[171]l3:[153][163]t[171]([171]t[172](t[179]1)))"-contx"c"":[137]650
  96. 500 [139]d[178]1[167]540
  97. 510 t[178]12[171]l7:[153][163]t[171]([171]t[172](t[179]1)))"contx"
  98. 511 [153][163]t[171]1)"tantantantan"
  99. 512 [153][163]t[171]1)d:[137]650
  100. 520 [139]c[179]0[167]525
  101. 521 t[178]10[171]l3:[153][163]t[171]([171]t[172](t[179]1)))"contx +"c"":[137]650
  102. 525 t[178]12[171]l3:[153][163]t[171]([171]t[172](t[179]1)))"contx"c"":[137]650
  103. 530 [139]b[178][171]1[167]532
  104. 531 t[178]13[171]l2:[153][163]t[171]([171]t[172](t[179]1)))""b"cmdcontx":[137]650
  105. 532 t[178]12:[153][163]t[171]([171]t[172](t[179]1)))"-contx":[137]650
  106. 540 [139]a1[178]0[175]e[178]0[167]543
  107. 541 t[178]13:[153][163]t[171]([171]t[172](t[179]1)))"contx"
  108. 542 [137]650
  109. 543 [153][163]12)"def(NULL)tantantantantantantantanright$"
  110. 544 [153][163]12)"peekcontx = "f:[153][163]21)"defonpeek"
  111. 545 [153][163]12)"mid$tantantantantantantantan(NULL)"
  112. 546 [153][163]34)"syscheck":[137]10340
  113. 550 [139]c[178]0[167]610
  114. 560 [139]d[178]1[167]630
  115. 570 [139]c[179]0[167]575
  116. 571 t[178]9[171]l1[171]l3:[153][163]t[171]([171]t[172](t[179]1)))a"cmd(contx+"c"cmd)"
  117. 572 [153][163]t[171]([171]t[172](t[179]1)))"tantantantantantantantantantantantan"
  118. 573 [153][163]t[170]3)d:[137]650
  119. 575 t[178]10[171]l1[171]l3:[153][163]t[171]([171]t[172](t[179]1)))a"cmd(contx"c"cmd)":[137]572
  120. 580 [139]d[178]1[167]640
  121. 590 [139]b[178][171]1[167]595
  122. 591 t[178]10[171]l1[171]l2:[153][163]t[171]([171]t[172](t[179]1)))a"cmd("b"cmdcontx)"
  123. 592 [153][163]t[171]([171]t[172](t[179]1)))"tantantantantantantantantantan"
  124. 593 [153][163]t[170]2)d:[137]650
  125. 595 t[178]9[171]l1:[153][163]t[171]([171]t[172](t[179]1)))a"cmd(-contx)":[137]592
  126. 600 [139]b[178][171]1[167]603
  127. 601 [139]c[179]0[167]605
  128. 602 t[178]10[171]l1[171]l2[171]l3:[153][163]t[171]([171]t[172](t[179]1)))""a"cmd("b"cmdcontx+"c"cmd)":[137]650
  129. 603 [139]c[179]0[167]606
  130. 604 t[178]8[171]l1[171]l3:[153][163]t[171]([171]t[172](t[179]1)))""a"cmd(-contx+"c"cmd)":[137]650
  131. 605 t[178]11[171]l1[171]l2[171]l3:[153][163]t[171]([171]t[172](t[179]1)))""a"cmd("b"cmdcontx"c"cmd)":[137]650
  132. 606 t[178]9[171]l1[171]l3:[153][163]t[171]([171]t[172](t[179]1)))" "a"cmd(-contx"c"cmd)":[137]650
  133. 610 [139]d[178]1[167]645
  134. 620 t[178]12[171]l1:[153][163]t[171]([171]t[172](t[179]1)))a"cmdcontx"
  135. 621 [153][163]t[171]([171]t[172](t[179]1)))"tantantantantan"
  136. 622 [153][163]t[170]1)d:[137]650
  137. 630 [139]c[179]0[167]635
  138. 631 t[178]9[171]l1[171]l3:[153][163]t[171]([171]t[172](t[179]1)))""a"cmd(contx+"c"cmd)":[137]650
  139. 635 t[178]10[171]l1[171]l3:[153][163]t[171]([171]t[172](t[179]1)))" "a"cmd(contx"c"cmd)":[137]650
  140. 640 [139]b[178][171]1[167]644
  141. 641 t[178]10[171]l1[171]l2:[153][163]t[171]([171]t[172](t[179]1)))" "a"cmd("b"cmdcontx)":[137]650
  142. 644 t[178]9[171]l1:[153][163]t[171]([171]t[172](t[179]1)))""a"cmd(-contx)":[137]650
  143. 645 [139]a[178][171]1[167]647
  144. 646 t[178]13[171]l1:[153][163]t[171]([171]t[172](t[179]1)))""a"cmdcontx":[137]650
  145. 647 t[178]11:[153][163]t[171]([171]t[172](t[179]1)))"        -contx"
  146. 650 t[178]14:[139]a1[178]0[167]720
  147. 660 [139]a1[178]1[167]730
  148. 670 [139]b1[178]1[167]780
  149. 680 [139]c1[178]0[167]820
  150. 690 [139]d1[178]1[167]850
  151. 700 [139]e[178]0[167]870
  152. 710 [139]b1[178][171]1[167]713
  153. 711 [139]c1[179]0[167]715
  154. 712 [153][163]t[171]([171]t[172](t[179]1)))"ononon   "a1"cmd("b1"cmdcontx+"c1"cmd)":[137]717
  155. 713 [139]c1[179]0[167]716
  156. 714 [153][163]t[171]([171]t[172](t[179]1)))"ononon   "a1"cmd(-contx+"c1"cmd)":[137]717
  157. 715 [153][163]t[171]([171]t[172](t[179]1)))"ononon   "a1"cmd("b1"cmdcontx"c1"cmd)":[137]717
  158. 716 [153][163]t[171]([171]t[172](t[179]1)))"ononon   "a1"cmd(-contx"c1"cmd)":[137]717
  159. 717 [139]e[179]0[167]719
  160. 718 [153][163]t[171]([171]t[172](t[179]1)))" + tantantantantantantantantantan +"e"= "f:[153][163]t[171]([171]t[172](t[179]1)))"     "d1:[137]2000
  161. 719 [153][163]t[171]([171]t[172](t[179]1)))" + tantantantantantantantantantan "e"= "f:[153][163]t[171]([171]t[172](t[179]1)))"      "d1:[137]2000
  162. 720 [139]e[178]0[167]725
  163. 721 [139]e[179]0[167]726
  164. 722 [153][163]t[171]([171]t[172](t[179]1)))"onon +"e"= "f"":[137]2000
  165. 725 [153][163]t[171]([171]t[172](t[179]1)))"onon = "f"":[137]2000
  166. 726 [153][163]t[171]([171]t[172](t[179]1)))"onon"e"= "f"":[137]2000
  167. 730 [139]b1[178]1[167]880
  168. 740 [139]c1[178]0[167]920
  169. 750 [139]d1[178]1[167]950
  170. 760 [139]e[178]0[167]970
  171. 770 [139]c1[179]0[167]773
  172. 771 [139]b1[178][171]1[167]779
  173. 772 t1[178]t[170]l5[170]l6[170]5:[153][163]t[171]([171]t[172](t[179]1)))"ononon   "b1"cmdcontx+"c1:[137]774
  174. 773 t1[178]t[170]l5[170]l6[170]5:[153][163]t[171]([171]t[172](t[179]1)))"ononon   "b1"cmdcontx"c1
  175. 774 [153][163]t[171]([171]t[172](t[179]1)))" + tantantantantantantantantan"
  176. 775 [139]e[179]0[167]777
  177. 776 [153][163]t1)"on +"e"= "f:[137]778
  178. 777 [153][163]t1)"on "e"= "f
  179. 778 [153][163]t[171]([171]t[172](t[179]1)))"     "d1:[137]2000
  180. 779 t1[178]t[170]l6[170]6:[153][163]t[171]([171]t[172](t[179]1)))"ononon   -contx+"c1:[137]774
  181. 780 [139]c1[178]0[167]980
  182. 790 [139]d1[178]1[167]1010
  183. 800 [139]e[178]0[167]1030
  184. 810 [139]c1[179]0[167]812
  185. 811 [153][163]t[171]([171]t[172](t[179]1)))"ononon   "a1"cmd(contx+"c1"cmd)":[137]813
  186. 812 [153][163]t[171]([171]t[172](t[179]1)))"ononon   "a1"cmd(contx"c1"cmd)"
  187. 813 [139]e[179]0[167]815
  188. 814 [153][163]t[171]([171]t[172](t[179]1)))" + tantantantantantantantantan +"e"= "f:[137]816
  189. 815 [153][163]t