home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
UpTime Volume 2 #3
/
utv2n3s2.d64
/
calcalc
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-28
|
10KB
|
345 lines
300 rem *******************************
400 rem * *
500 rem * written by m.d. smith *
600 rem * 1000 monte sano blvd.,s.e. *
700 rem * huntsville, al 35801 *
800 rem * version 8.802 2/14/88 *
900 rem * (205) 533-3131 *
1000 rem*******************************
1100 poke53280,15:poke 53265,11:poke53281,15:rem screen
1150 print"[147]"
1200 date$="06-01-88"
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]"
1500 for x=1to10
1600 printspc(9)"[221]"spc(20)"[221]"
1700 next
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]"
1900 print"[145][145][145][145][145][145][145][145][145]"spc(14)" [213]p[212]ime ":print
2000 printspc(16)"[208]resents":print
2100 printspc(11)"[149][195]alorie [195]alculator":print
2200 printspc(13)"[144]by [205]. [196]. [211]mith"
2300 print:print:print
2400 for y=1to5
2500 printspc(7);
2600 for x=2to15
2700 poke 646,x
2800 print" ";
2900 next x:print
3000 next y
3100 printspc(8)"[145][145][145][145][144] [203]eep [195]ount of [195]alories "
3200 printspc(8)"[144] [204]oading [196]ata "
3300 printspc(8)"[144] [207]ne moment, please "
3400 print:print" [208]ublished by [211]oftdisk [208]ublishing, [201]nc."
3410 dimct$(50),ft$(50),ct(500),un(99)
3420 dimfo$(200),cal$(200),cal(200)
3430 dimf$(200),u(200),mi(99),ml$(99)
3440 me2$="breakfast":ml=1:poke53280,6:poke 53265,27
3500 gosub 9400:printtab(13)"[145][145][145][145][145] "
3550 printtab(11)" [146]"
3600 gosub 28700:poke 53280,0:poke 53281,0:poke 646,7
3700 rem ======================== main menu screen ========================
3800 rem print chr$(14)
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]";
4000 for p=1 to 22
4100 print "[221][157][157][221]";
4200 next p
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]";
4400 print "[158]":rem cursor ups
4500 rem ======================== printer hardcopy =======================
4600 poke 53280,0:poke 53281,0:poke 646,7
4700 rem
4800 rem
4900 cd=1:rem set counter for meal incrementer
5300 me2$="breakfast":ml=1
5500 rem ********** version of feb. 14, 1988 *********
5600 rem 3 inst. screens
5700 print tab(4)"[196]o you want [201]nstructions ([217]/[206])"
5900 getis$:ifis$=""then5900
6000 ifis$="[206]" oris$="n"then10400
6100 if is$<>"y" and is$<>"[217]" then 5900
6400 print"[147][212]his program will allow you to input a"
6500 print"days foods and calculate the total "
6600 print"calories consumed. [217]ou can do it for"
6700 print"any number of meals."
6800 print"[212]he screen that you will see will
6900 [153]"ask you to input the date and which"
7000 [153]"meal or snack you want this called."
7100 [153]"(NULL)hen prompted for date and meal,"
7200 [153]"pressing <(NULL)val(NULL)(NULL)(NULL)(NULL)> alone, will print"
7300 [153]"program date and ";[199](34);"breakfast.";[199](34)""
7400 [141]28700
7500 [153]"load(NULL)ou will need to type the name of the"
7600 [153]"food (spelled correctly)...and wait for"
7700 [153]"the program to find it in memory. right$f it"
7800 [153]"does, it will then ask you to input the"
7900 [153]"amount you have eaten, in units (liquid"
8000 [153]"or weight). right$f the food is not found,"
8100 [153]"or it is misspelled, you should enter "
8200 [153]"";[199](34);"s";[199](34);" to search the food database"
8300 [153]"to get the correct spelling or listing."
8400 [141]28700
8500 [153]"load(NULL)ou must burn 3500 calories more than"
8600 [153]"you eat to lose a pound. (NULL)he average"
8700 [153]"person will be stable on about 2100-"
8800 [153]"2300 calories a day. right$f you eat 1200 "
8900 [153]"calories a day, you should lose about"
9000 [153]"two pounds a week. ascor shopping, print"
9100 [153]"out the entire list of foods as a"
9200 [153]"guide to take with you."
9300 [141]28700
9350 [137] 10400
9400 [143] ==== load file of data ====
9410 x[178]1:[159] 15,8,15,"i0"
9420 [141] 9500:[139] fl[178]1 [167] 9400
9440 [159] 2,8,2,"0:calcalc.dta"
9450 [141] 9500:[139] fl[178]1 [167] 9400
9460 [132]2,fo$(x),cal$(x),cal(x)
9470 x[178]x[170]1
9480 [139](st [175] 64)[178]0[167]9460
9490 [160]2:[160] 15:et[178]x:[142]
9500 [161]#15,a$:[139] a$[178]"0" [167] fl[178]0:[142]
9505 fl[178]1:[151] 53281,0
9510 fl[178]1:[153]"loaddef str$isk valrror: sys"a$;
9520 [161]#15,a$:[153]a$;
9530 [139] a$[179][177][199](13) [167] 9520
9535 [160] 2:[160] 15
9540 [153][163]6)"def(open(NULL)def)etry or (open(NULL)def)uit to (NULL)p(NULL)ime?stop"
9550 [161] a$:[139] a$[178]"r" [167] [153]"load";:[142]
9560 [139] a$[178]"q" [167] 9600
9570 [137] 9550
9600 [151]204,1:[158] 8[172]4096[170]4
10400 [153]"load=======================================sys"
10410 [153]"======== lenallenalc right$nput (NULL)creen =========sys"
10412 [153]"=======================================sys"
10500 [153] [166]2);"(NULL)hat date do you want to use"
10600 [153] [166]2);"for your entry ((NULL)(NULL)-str$str$-(NULL)(NULL)) ";
10650 rx[178]1:mx[178]8:[141] 32000
10700 dl$[178]o1$
10710 [153]
10800 [139]dl$[178]""[167]dl$[178]date$:[137]10900
10900 [153]:[153]" (NULL)he date for this"
11000 [153]" entry is....";dl$;"sys"
11100 s2[178]0
11200 [153]:[153]
11300 [153]"(NULL)hat meal is this (or snack)"
11400 [153]"(default is breakfast) ";
11450 rx[178]2:mx[178]16:[141] 32000
11455 me$[178]o1$
11500 [139]me$[178]""[167] me$[178]"breakfast"
11550 [153]
11600 [153]:[153]"(NULL)k, this entry is for ";me$;"sys"
11700 [153]:[153]
11800 [141]28700
11900 [153][199](147);
12000 [139]ic[178]0[167]ic[178]1:[143] for first time,set incremental counter to 1
12100 [143] cursor 3,10:
12200 [153]"printreturn ***** mealplan and calorie *****"
12300 [153]" ***** chart for ";dl$;" *****for"
12400 [153]" enter food name or 'tfor' to total meal,"
12500 [153]" 'sfor' to search food list or 'efor' to end"
12600 f[178]1
12700 z[178]1
12800 [153]"sysname of food: cmd";
12810 rx[178]3:mx[178]22:[141] 32000
12815 [139] o1$[178]"" [167] [153]"onon";:[137] 12800
12820 f$(f)[178]o1$
12821 [153]
12900 [129] zz[178]1 [164] 15:[153]" ":[130]
12950 [153]" ";
12975 [153]" ";
13000 [153]"ononononononononononononononon":[143] 12 cursor ups arrow keys,and ^,*, to search for
13100 [139]f$(f)[178]"(NULL)"[176]f$(f)[178]"t"[167]15300
13200 [139]f$(f)[178]"val"[176]f$(f)[178]"e"[167]29200
13300 [139]f$(f)[178]"(NULL)"[176]f$(f)[178]"s"[167][141]21600
13400 [129]z[178]1[164]et[170]1
13500 [139]f$(f)[178]fo$(z)[167]13900
13600 [139]fo$(z)[178]"end"[167][141]20200:[137]11900:[143] can't find a match
13700 [139]z[177]et[167][141]20200:[137]11900
13800 [130]z
13900 [153]:[153]:[153]fo$(z),cal$(z)
14000 [153]:[153]"how many units of this food: ";:mx[178]3:[141]32000:u(f)[178][197](o1$)
14100 [153]:[153]"for for";f$(f);"sys you have ";(u(f)[172]cal(z));" cals."
14200 t2[178](u(f)[172]cal(z))
14300 s2[178]s2o[170]t2
14400 c2[178]c2[170]t2
14500 [153]:[153]"total for ";me$;" is";s2;"cals."
14600 [153]:[153]"total for the day is";c2;"cals."
14700 [141]28700
14800 ft$(ic)[178]f$(f):[143] this is name of food for this icrement
14900 un(ic)[178]u(f):[143] this is units of the food selected for this inc.
15000 ct(ic)[178]t2:[143] this is the total cal for this food
15100 ic[178]ic[170]1
15200 [137]11900
15300 [153][199](147)
15400 [143] cursor 10,10
15500 [153]"you asked for a total for ";me$;"."
15600 [143]
15700 [153]"you have ";s2;" cals. for this meal."
15800 [143]
15900 [153]"you have ";c2;" cals. for the day."
16000 [143]
16100 [153]"want to continue to addsys foods to this same meal (y/n) [n] "
16150 [151] 198,0
16200 [161]ad$:[139]ad$[178]""[167]16200
16400 [139]ad$[178]