home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 2 #3 / utv2n3s2.d64 / calcalc (.txt) < prev    next >
Commodore BASIC  |  2022-08-28  |  10KB  |  345 lines

  1. 300 rem *******************************
  2. 400 rem *                             *
  3. 500 rem *  written by m.d. smith      *
  4. 600 rem *  1000 monte sano blvd.,s.e. *
  5. 700 rem *  huntsville, al  35801      *
  6. 800 rem *  version 8.802  2/14/88     *
  7. 900 rem *  (205) 533-3131             *
  8. 1000 rem*******************************
  9. 1100 poke53280,15:poke 53265,11:poke53281,15:rem screen
  10. 1150 print"[147]"
  11. 1200 date$="06-01-88"
  12. 1400 print"[147]"spc(9)"[176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
  13. 1500 for x=1to10
  14. 1600 printspc(9)"[221]"spc(20)"[221]"
  15. 1700 next
  16. 1800 printspc(9)"[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
  17. 1900 print"[145][145][145][145][145][145][145][145][145]"spc(14)"   [213]p[212]ime  ":print
  18. 2000 printspc(16)"[208]resents":print
  19. 2100 printspc(11)"[149][195]alorie [195]alculator":print
  20. 2200 printspc(13)"[144]by [205]. [196]. [211]mith"
  21. 2300 print:print:print
  22. 2400 for y=1to5
  23. 2500 printspc(7);
  24. 2600 for x=2to15
  25. 2700 poke 646,x
  26. 2800 print"  ";
  27. 2900 next x:print
  28. 3000 next y
  29. 3100 printspc(8)"[145][145][145][145][144] [203]eep [195]ount of [195]alories "
  30. 3200 printspc(8)"[144]      [204]oading [196]ata      "
  31. 3300 printspc(8)"[144]   [207]ne moment, please   "
  32. 3400 print:print" [208]ublished by [211]oftdisk [208]ublishing, [201]nc."
  33. 3410 dimct$(50),ft$(50),ct(500),un(99)
  34. 3420 dimfo$(200),cal$(200),cal(200)
  35. 3430 dimf$(200),u(200),mi(99),ml$(99)
  36. 3440 me2$="breakfast":ml=1:poke53280,6:poke 53265,27
  37. 3500 gosub 9400:printtab(13)"[145][145][145][145][145]             "
  38. 3550 printtab(11)"                  [146]"
  39. 3600 gosub 28700:poke 53280,0:poke 53281,0:poke 646,7
  40. 3700 rem ========================  main menu screen ========================
  41. 3800 rem print chr$(14)
  42. 3900 print"[147][176][192][192][192][192][192][192][192][192][192] [195]alorie [195]alculator [192][192][192][192][192][192][192][192][192][174]";
  43. 4000 for p=1 to 22
  44. 4100 print "[221][157][157][221]";
  45. 4200 next p
  46. 4300 print "[173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]";
  47. 4400 print "[158]":rem cursor ups
  48. 4500 rem ======================== printer hardcopy   =======================
  49. 4600 poke 53280,0:poke 53281,0:poke 646,7
  50. 4700 rem
  51. 4800 rem
  52. 4900 cd=1:rem set counter for meal incrementer
  53. 5300 me2$="breakfast":ml=1
  54. 5500 rem       **********    version of feb. 14, 1988  *********
  55. 5600 rem 3 inst. screens
  56. 5700 print tab(4)"[196]o you want [201]nstructions ([217]/[206])"
  57. 5900 getis$:ifis$=""then5900
  58. 6000 ifis$="[206]" oris$="n"then10400
  59. 6100 if is$<>"y" and is$<>"[217]" then 5900
  60. 6400 print"[147][212]his program will allow you to input a"
  61. 6500 print"days foods and calculate the total "
  62. 6600 print"calories consumed.  [217]ou can do it for"
  63. 6700 print"any number of meals."
  64. 6800 print"[212]he screen that you will see will
  65. 6900 [153]"ask you to input the date and which"
  66. 7000 [153]"meal or snack you want this called."
  67. 7100 [153]"(NULL)hen prompted for date and meal,"
  68. 7200 [153]"pressing <(NULL)val(NULL)(NULL)(NULL)(NULL)> alone, will print"
  69. 7300 [153]"program date and ";[199](34);"breakfast.";[199](34)""
  70. 7400 [141]28700
  71. 7500 [153]"load(NULL)ou will need to type the name of the"
  72. 7600 [153]"food (spelled correctly)...and wait for"
  73. 7700 [153]"the program to find it in memory.  right$f it"
  74. 7800 [153]"does, it will then ask you to input the"
  75. 7900 [153]"amount you have eaten, in units (liquid"
  76. 8000 [153]"or weight).  right$f the food is not found,"
  77. 8100 [153]"or it is misspelled, you should enter "
  78. 8200 [153]"";[199](34);"s";[199](34);" to search the food database"
  79. 8300 [153]"to get the correct spelling or listing."
  80. 8400 [141]28700
  81. 8500 [153]"load(NULL)ou must burn 3500 calories more than"
  82. 8600 [153]"you eat to lose a pound.  (NULL)he average"
  83. 8700 [153]"person will be stable on about 2100-"
  84. 8800 [153]"2300 calories a day.  right$f you eat 1200 "
  85. 8900 [153]"calories a day, you should lose about"
  86. 9000 [153]"two pounds a week.  ascor shopping, print"
  87. 9100 [153]"out the entire list of foods as a"
  88. 9200 [153]"guide to take with you."
  89. 9300 [141]28700
  90. 9350 [137] 10400
  91. 9400 [143] ==== load file of data ====
  92. 9410 x[178]1:[159] 15,8,15,"i0"
  93. 9420 [141] 9500:[139] fl[178]1 [167] 9400
  94. 9440 [159] 2,8,2,"0:calcalc.dta"
  95. 9450 [141] 9500:[139] fl[178]1 [167] 9400
  96. 9460 [132]2,fo$(x),cal$(x),cal(x)
  97. 9470 x[178]x[170]1
  98. 9480 [139](st [175] 64)[178]0[167]9460
  99. 9490 [160]2:[160] 15:et[178]x:[142]
  100. 9500 [161]#15,a$:[139] a$[178]"0" [167] fl[178]0:[142]
  101. 9505 fl[178]1:[151] 53281,0
  102. 9510 fl[178]1:[153]"loaddef str$isk valrror: sys"a$;
  103. 9520 [161]#15,a$:[153]a$;
  104. 9530 [139] a$[179][177][199](13) [167] 9520
  105. 9535 [160] 2:[160] 15
  106. 9540 [153][163]6)"def(open(NULL)def)etry or (open(NULL)def)uit to (NULL)p(NULL)ime?stop"
  107. 9550 [161] a$:[139] a$[178]"r" [167] [153]"load";:[142]
  108. 9560 [139] a$[178]"q" [167] 9600
  109. 9570 [137] 9550
  110. 9600 [151]204,1:[158] 8[172]4096[170]4
  111. 10400 [153]"load=======================================sys"
  112. 10410 [153]"======== lenallenalc right$nput (NULL)creen =========sys"
  113. 10412 [153]"=======================================sys"
  114. 10500 [153] [166]2);"(NULL)hat date do you want to use"
  115. 10600 [153] [166]2);"for your entry ((NULL)(NULL)-str$str$-(NULL)(NULL)) ";
  116. 10650 rx[178]1:mx[178]8:[141] 32000
  117. 10700 dl$[178]o1$
  118. 10710 [153]
  119. 10800 [139]dl$[178]""[167]dl$[178]date$:[137]10900
  120. 10900 [153]:[153]"  (NULL)he date for this"
  121. 11000 [153]"  entry is....";dl$;"sys"
  122. 11100 s2[178]0
  123. 11200 [153]:[153]
  124. 11300 [153]"(NULL)hat meal is this (or snack)"
  125. 11400 [153]"(default is breakfast) ";
  126. 11450 rx[178]2:mx[178]16:[141] 32000
  127. 11455 me$[178]o1$
  128. 11500 [139]me$[178]""[167] me$[178]"breakfast"
  129. 11550 [153]
  130. 11600 [153]:[153]"(NULL)k, this entry is for ";me$;"sys"
  131. 11700 [153]:[153]
  132. 11800 [141]28700
  133. 11900 [153][199](147);
  134. 12000 [139]ic[178]0[167]ic[178]1:[143]  for first time,set incremental counter to 1
  135. 12100 [143] cursor 3,10:
  136. 12200 [153]"printreturn    ***** mealplan and calorie *****"
  137. 12300 [153]"     ***** chart for ";dl$;" *****for"
  138. 12400 [153]" enter food name or 'tfor' to total meal,"
  139. 12500 [153]" 'sfor' to search food list or 'efor' to end"
  140. 12600 f[178]1
  141. 12700 z[178]1
  142. 12800 [153]"sysname of food:  cmd";
  143. 12810 rx[178]3:mx[178]22:[141] 32000
  144. 12815 [139] o1$[178]"" [167] [153]"onon";:[137] 12800
  145. 12820 f$(f)[178]o1$
  146. 12821 [153]
  147. 12900 [129] zz[178]1 [164] 15:[153]"                                 ":[130]
  148. 12950 [153]"                                        ";
  149. 12975 [153]"                                  ";
  150. 13000 [153]"ononononononononononononononon":[143] 12 cursor ups arrow keys,and ^,*, to search for
  151. 13100 [139]f$(f)[178]"(NULL)"[176]f$(f)[178]"t"[167]15300
  152. 13200 [139]f$(f)[178]"val"[176]f$(f)[178]"e"[167]29200
  153. 13300 [139]f$(f)[178]"(NULL)"[176]f$(f)[178]"s"[167][141]21600
  154. 13400 [129]z[178]1[164]et[170]1
  155. 13500 [139]f$(f)[178]fo$(z)[167]13900
  156. 13600 [139]fo$(z)[178]"end"[167][141]20200:[137]11900:[143] can't find a match
  157. 13700 [139]z[177]et[167][141]20200:[137]11900
  158. 13800 [130]z
  159. 13900 [153]:[153]:[153]fo$(z),cal$(z)
  160. 14000 [153]:[153]"how many units of this food: ";:mx[178]3:[141]32000:u(f)[178][197](o1$)
  161. 14100 [153]:[153]"for for";f$(f);"sys you have ";(u(f)[172]cal(z));" cals."
  162. 14200 t2[178](u(f)[172]cal(z))
  163. 14300 s2[178]s2o[170]t2
  164. 14400 c2[178]c2[170]t2
  165. 14500 [153]:[153]"total for ";me$;" is";s2;"cals."
  166. 14600 [153]:[153]"total for the day is";c2;"cals."
  167. 14700 [141]28700
  168. 14800 ft$(ic)[178]f$(f):[143] this is name of food for this icrement
  169. 14900 un(ic)[178]u(f):[143] this is units of the food selected for this inc.
  170. 15000 ct(ic)[178]t2:[143] this is the total cal for this food
  171. 15100 ic[178]ic[170]1
  172. 15200 [137]11900
  173. 15300 [153][199](147)
  174. 15400 [143] cursor 10,10
  175. 15500 [153]"you asked for a total for ";me$;"."
  176. 15600 [143]
  177. 15700 [153]"you have ";s2;" cals. for this meal."
  178. 15800 [143]
  179. 15900 [153]"you have ";c2;" cals. for the day."
  180. 16000 [143]
  181. 16100 [153]"want to continue to addsys foods to this    same meal (y/n) [n] "
  182. 16150 [151] 198,0
  183. 16200 [161]ad$:[139]ad$[178]""[167]16200
  184. 16400 [139]ad$[178]