home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1987 June / 1987-06.d64 / fractionpractice (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  3KB  |  100 lines

  1. 10 ba=53281:bo=53280:rem on the plus 4/16, use ba=65301:bo=65305
  2. 20 x=rnd(-ti):deffnc(x1)=int(10*rnd(1))+1
  3. 30 pokeba,1:pokebo,0:printchr$(142)
  4. 40 print"[147]      welcome to fraction practice[146]."
  5. 50 print"    do you need instructions (y/n)";:inputi$
  6. 60 pokeba,0:pokebo,1
  7. 70 print"[147]to add or subtract fractions, you must
  8. 80 [153]"first give a common denominator (unless
  9. 90 print"the two denominators are already the
  10. 100 [153]"same). the common denominator must be
  11. 110 print"no larger than the two denominators
  12. 120 [153]"multiplied together. then give each new
  13. 130 print"numerator and finally, give the answer."
  14. 140 print"you may then be asked to simplify your
  15. 150 [153]"answer.
  16. 160 printtab(12)"press any key...
  17. 170 [161] q$:[139] q$[178]""[167]170
  18. 180 [153]"loadif you need to ewaitscape back to the"
  19. 190 [153]"start of any problem,";
  20. 200 [153]" just enter e:wait"
  21. 210 [153]"remember... to ewaitscape, enter e:wait."
  22. 220 [153]"which operation would you care to try?
  23. 230 print"            1 = addition, or
  24. 240 [153]"            2 = subtraction ";
  25. 250 [133]m:[139] m[179]1 [176] m[177]2 [167]180
  26. 260 [153]"load":[151]ba,4:[151]bo,7[170]5[172]16:p[178]0
  27. 270 x[178][165]c(x1):y[178][165]c(x1):[139]x[177][178]y[167]270
  28. 280 a[178][165]c(x1):b[178][165]c(x1):[139]a[177][178]b[167]280
  29. 290 [139] m[178]2 [175] x[173]y[179][178]a[173]b [167]270
  30. 300 p[178]p[170]1:[139] p[177]20 [167]940
  31. 310 [153]"loadsysthis is problem number"p"cmd.":[153]"  "x[163]10)a
  32. 320 p$[178]"+":[139]m[178]2[167]p$[178]"-"
  33. 330 [153]"   lenlen  "p$"   lenlen   =":[153]"  "y[163]10)b
  34. 340 [153]"the common denominator is ";
  35. 350 [139] y[178]b [167] [153]y:t[178]y:[137]470
  36. 360 [133] t
  37. 370 [139] t[178]e [167]310
  38. 380 [139] t[178]0 [167] [153]"the denominator can't be zero.ononon":[137]340
  39. 390 [139] t[177]b[172]y [167] [153]"please find a smaller one.     ":[137]340
  40. 400 [129] d[178]1 [164] b[172]y
  41. 410 [139] (b[172]y)[173]d[178][181]((b[172]y)[173]d) [175] [181]((b[172]y)[173]d) [167]440
  42. 420 [130] d
  43. 430 [137]460
  44. 440 [139] t[173]b[178][181](t[173]b) [175] t[173]y[178][181](t[173]y)[167]470
  45. 450 [130] d
  46. 460 [153]"sorry, that number won't work...ononon":[137]340
  47. 470 [153]"   lenlen  "p$"   lenlen   =":[153][163]2)t[163]10)t
  48. 480 [153]"the first numerator is...ononononcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmd";
  49. 490 [133] s1
  50. 500 [139] s1[178]e [167]310
  51. 510 [153]"on  "s1
  52. 520 [139] s1[179][177]t[173]y[172]x [167] [153]"sorry, try  again...ononon":[137]480
  53. 530 [153]"the second numerator is...onononononcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmd";
  54. 540 [133] s2
  55. 550 [139] s2[178]e [167]310
  56. 560 [153][163]8)"on  "s2
  57. 570 [139] s2[179][177]t[173]b[172]a [167] [153]"sorry, try again...onononononon" :[137]530
  58. 580 [153]"your answer is...   lenlen";:[153]"oncmdcmdcmdcmd";:[133]s3
  59. 590 [139] s3[178]e [167]310
  60. 600 [153][163]18)"on "s3
  61. 610 [153]""[163]18);:[133] t1:[153][163]18)"on "t1
  62. 620 [139] t1[178]e [167]310
  63. 630 [139](m[179][177]1 [176] s3[178]s1[170]s2)[175] (m[179][177]2 [176] s3[178]s1[171]s2)[167]650
  64. 640 [153]"wrong numerator...ononononononononononon":[137]580
  65. 650 [139] t1[179][177]t [167] [153]"wrong denominatorononononononononononon":[137]580
  66. 660 [139] s3[179]t1 [167]790
  67. 670 [153]"please change to a mixed numberonononcmdcmdcmdcmdcmdcmdcmdcmdcmd = ";:[133]m1
  68. 680 [139] m1[178]e [167]310
  69. 690 [139] m1[179][177]1[167][153]"try again...                      onon":[137]670
  70. 700 [153][163]27)"ononcmd(NULL)sgncmdcmdcmd  sgncmdcmdand(NULL)onon";:[139]s3[178]t1[167][153]"":[137]910
  71. 710 [133]s5:[139] s5[178]e [167]310
  72. 720 [153]"on"[163]28)" "s5
  73. 730 [139] s5[179][177]s3[171]t1 [167][153]"try again...                      ononon":[137]700
  74. 740 [153][163]30)"lenlencmdcmdcmdcmd";:[133]t5
  75. 750 [139] t5[178]e [167]310
  76. 760 [153]"on"[163]28)" "t5
  77. 770 [139] t5[179][177]t1 [167] [153]"try again...                onononcmdcmdcmdcmd"[163]26);:[137]740
  78. 780 s3[178]s5
  79. 790 [129] g[178](b[172]y)[164] 2 [169] [171]1
  80. 800 [139] s3[173]g[178][181](s3[173]g) [175] t1[173]g[178][181](t1[173]g) [167]820
  81. 810 [130] g:[137] 910
  82. 820 [153]"please simplify...                onononcmdcmdcmdcmdcmdcmdcmdcmdcmdcmdcmd=on";
  83. 830 [153][163]28);:[133] s4:[153]"on"[163]28)" "s4"  ":[153][163]30)"lenlen"
  84. 840 [139] s4[178]e [167]310
  85. 850 [153][163]28):[133] t2
  86. 860 [139] t2[178]e [167]310
  87. 870 [153]"on"[163]28)" "t2
  88. 880 [139] s4[178]s3[173]g [175] t2[178]t1[173]g [167] [137]910
  89. 890 [153]"incorrect...please simplify again ononononcmdcmdcmdcmdcmdcmdcmdcmd";:[137]830
  90. 900 [153]"incorrect...     ":[137]830
  91. 910 [153]"well done!wait"
  92. 920 [141]990
  93. 930 [137]270
  94. 940 [153]"do you wish another set of problems"
  95. 950 [153]"(y/n)";
  96. 960 [133] q$
  97. 970 [139] q$[179][177]"y"[167][153]"load":[128]
  98. 980 [137]180
  99. 990 [129]v[178]1[164]400:[130]v:[142]
  100.