This repository has been archived by the owner on Sep 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prg.txt
executable file
·173 lines (152 loc) · 6.82 KB
/
prg.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
!- ========================================
!- Project : Cookie Clicker
!- Target : Commodore 64
!- Comments : Cookie Clicker for the C64.
!- Author : Ian M. Skinner
!- ========================================
0 rem !to "build/cookie.prg"
10 mb=17:dimna$(mb):dimia(mb):dimbd$(mb):dimbg(mb):dimpr(mb):dimcg(mb):rem create arrays for item data
20 open 8,8,8,"storedat,s,r":rem load item data
30 forx=0tomb
40 input#8,na$(x):rem building name
50 input#8,bd$(x):rem building description
55 input#8,bg(x):rem building cps (not actually per second)
60 input#8,pr(x):rem building price
65 ?x+1"/"mb+1:
70 next
80 close 8
90 ms=1:bn$="someone's":r1$="{right*17}":rem ms is the main subroutine value, bn is the name
95 r2$="{right*17}":ss=1:rem huh? that isn't right. why are r1 and r2 the same?
100 rem stick news here. Also ss is the shop page. (to be named sp)
110 print"{brown}{clear}UCCCCCCCCCCCCCCC{cm r}CCCCCCCCCCCCCCCCCCCCCCI";:rem print static screen
120 print"B B B";
130 print"B B B";
140 print"{cm q}CCCCCCCCCCCCCCC{cm w} B";
150 print"B B B";
160 print"B B B";
170 print"B B B";
180 print"B {reverse on} {reverse off} B B";
190 print"B {reverse on} {black} {brown} {reverse off} B B";
200 print"B {reverse on} {black} {brown} {reverse off} B B";
210 print"B {reverse on} {black} {brown} {black} {brown} {reverse off} B B";
220 print"B {reverse on} {black} {brown} {black} {brown} {reverse off} B B";
230 print"B {reverse on} {reverse off} B B";
240 print"B {reverse on} {reverse off} B B";
250 print"B {reverse on} {black} {brown} {reverse off} B B";
260 print"B {reverse on} {black} {brown} {black} {brown} {black} {brown} {reverse off} B B";
270 print"B {reverse on} {black} {brown} {black} {brown} {reverse off} B B";
280 print"B {reverse on} {reverse off} B B";
290 print"B {reverse on} {reverse off} B B";
300 print"B {reverse on} {reverse off} B B";
310 print"B B B";
320 print"B{white} v2.9.0-1.0 {brown}B B";
330 print"JCCCCCCCCCCCCCCC{cm e}CCCCCCCCCCCCCCCCCCCCCCK";
340 print"{white} {reverse on}f1{reverse off} store {reverse on}f3{reverse off} options {reverse on}f5{reverse off} stats {reverse on}f7{reverse off} ascend";
500 print"{home}{down}{right}"int(cc)
510 print"{brown}B{white} cookies"
520 ?"{brown}B{white}"bn$
530 print"{up}{brown}B{white} bakery"
1000 on ms gosub 2000, 5000:rem, 7000
1010 goto 1000:rem the menu selector
2000 ifms<>1thenreturn :rem store page selection and menu switching area.
2010 ifss>0theni=0:j=4:ifss>1theni=5:j=9:ifss>2theni=10:j=14:ifss>3theni=15:j=17
2060 ts=ss:tm=ms :rem 2010 sets the range of item data
2090 gosub2500 :rem to be used. do not have a range
2100 goto2000 :rem bigger than 5. (smaller is fine)
2500 gosub51000:rem clear dynamic window
2505 y=1:forx=itoj :rem this section prints the
2510 ifx=ithen?"{home}" :rem item data in the given range. (it prints the specified page)
2515 ?r1$"{up}{reverse on}"right$(str$(y),1)"{reverse off} "na$(x)
2520 ?r1$r2$"{up}"ia(x)
2530 ?r1$bd$(x)
2540 ?r1$"{up}"int(pr(x))
2545 ?r1$"{cm t*22}":y=y+1:rem the bars below each item
2550 next
2555 ifj=17then?r1$"{down*7} prev/next(-/+)"
2560 ?r1$"{up} prev/next(-/+)"
2565 gosub 3000:rem goes to actual shop routine
2570 return
3000 get k$:x=0
3010 gosub 60000:rem adding routine
3015 ifval(k$)>5then3070
3020 ifval(k$)<1then3070
3025 x=val(k$)
3065 gosub 3500:rem purchase item
3070 gosub 50000:rem change menu
3080 ifk$="+"thenss=ss+1:rem change store page
3085 ifk$="-"thenss=ss-1
3090 ifss=0thenss=1
3095 ifss=5thenss=4
3110 ifss<>tsthenreturn:rem return if different page was selected
3120 ifms<>tmthenreturn:rem return if different menu was selected
3130 goto 3000
3500 y=i+x-1:ify>mbthenreturn :rem buying subroutine
3510 if cc<pr(y)then3610
3515 if ia(y)=300then3610:rem item cap (otherwise you'd have prices too big to handle)
3520 cc=cc-pr(y):cg(y)=cg(y)+bg(y):pr(y)=pr(y)*1.15:ia(y)=ia(y)+1
3530 ifx=1then?"{home}"r1$r2$"{down}"ia(y):rem find a better way to do this
3540 ifx=2then?"{home}"r1$r2$"{down*5}"ia(y)
3550 ifx=3then?"{home}"r1$r2$"{down*9}"ia(y)
3560 ifx=4then?"{home}"r1$r2$"{down*13}"ia(y)
3565 ifx=5then?"{home}"r1$r2$"{down*17}"ia(y)
3570 ifx=1then?"{home}"r1$"{down*3}"int(pr(y))
3580 ifx=2then?"{home}"r1$"{down*7}"int(pr(y))
3590 ifx=3then?"{home}"r1$"{down*11}"int(pr(y))
3600 ifx=4then?"{home}"r1$"{down*15}"int(pr(y))
3605 ifx=5then?"{home}"r1$"{down*19}"int(pr(y))
3610 x=0:return
5000 ifms<>2thenreturn
5010 tm=ms
5020 gosub5100
5030 goto5000
5100 ?"{home}{down}"r1$"{reverse on}1{reverse off} change your bakery's"
5110 ?r1$"name"
5120 ?r1$"{cm t*22}{down}"
5130 ?r1$"{up}{reverse on}2{reverse off} create a save file"
5140 ?r1$"on a disk"
5150 ?r1$"{cm t*22}{down}"
5160 ?r1$"{up}{reverse on}3{reverse off} load a save file"
5170 ?r1$"from a disk"
5180 ?r1$"{cm t*22}{down}"
5190 ?r1$"{up}{reverse on}4{reverse off} manage your saves"
5195 ?r1$"{down}{cm t*22}{down}"
5200 getk$ :rem
5210 ifval(k$)>4then5240 :rem main loop
5220 ifval(k$)<1then5240 :rem
5230 onval(k$)gosub5700,5900
5240 gosub 50000:gosub 60000
5250 ifms<>tmthenreturn
5260 goto 5200
5700 print"1":open 8,8,8,"@0:savedat,s,w":rem save data
5710 print#8,al
5720 print#8,bn$
5730 print#8,cc
5740 forx=0tomb
5750 print#8,cg(x)
5760 print#8,pr(x)
5770 print#8,ia(x)
5780 next:close 8:return
5900 print"2":open 8,8,8,"@0:savedat,s,r":rem load data
5910 input#8,al
5920 input#8,bn$
5930 input#8,cc
5940 forx=0tomb
5950 input#8,cg(x)
5960 input#8,pr(x)
5970 input#8,ia(x)
5980 next:close 8:return
10000 stop
49999 :rem important subroutines
50000 ifk$="{f1}"then50040:rem menu selecting
50010 ifk$="{f3}"then50040
50020 ifk$="{f5}"then50040
50030 return
50040 ms=-1*(k$="{f1}")-2*(k$="{f3}")-3*(k$="{f5}"):return
51000 forx=1to20: rem clears the menu
51010 ifx=1then?"{home}"r1$"{down} ";
51020 ?r1$"{right} ";:next
51040 return
60000 b=0:fora=0tomb:b=b+(cg(a)/3.6):next:rem slow, horrible, not good adding subroutine
60010 ifk$=" "thencc=cc+1
60020 ifcb>ccthen?"{home}{down}{right} "
60030 cc=cc+b:?"{home}{down}{right}"int(cc):cb=cc:return