-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLife simulator.py
More file actions
796 lines (786 loc) · 35.4 KB
/
Life simulator.py
File metadata and controls
796 lines (786 loc) · 35.4 KB
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
print('Type ? for help')
print('Life simulator.\nversion 1.7.1\nNow celebrating 1179 lines of code!')
import os
from time import gmtime, strftime
import time
if os.name == 'nt':
import winsound
winsound.SND_ALIAS
def beep(freq, dur):
if os.name == 'nt':
winsound.Beep(freq, dur)
def microwave(microtime, item, new_item):
if item in pantry:
while microtime > 0:
print('microwave ', microtime, jsec)
time.sleep(1)
microtime -= 1
pantry.append(new_item)
pantry.remove(item)
print('Food')
beep(1700, 1000)
time.sleep(0.5)
print('is')
beep(1700, 1000)
time.sleep(0.5)
print('ready!')
beep(1700, 1000)
time.sleep(0.5)
beep(1700, 1500)
time.sleep(1)
import random
basket = []
dq = 0
weather = 'clear'
working = 0
mblhome = 0
rnchhome = 0
logcbn = 0
burger = 2
os.environ['TZ'] = 'US/Eastern'
b = 0
apm = 'am'
clkmin = strftime("%S", gmtime())
clkhr = 6
apples = 2
carrot = 2
money = 1000.00
happiness = 100
hunger = 100
clkhr1 = 1
xxp = 0
payed = 0
pantry = []
checkpriceaple = 0
checkpricecrrts = 0
clkday = 1
home = 'tent'
print('day:', clkday)
work = 0
shoe = 0
mc = 0
jobevent = 0
microwave = 2
apply = []
xp = 0
jsec = 'seconds'
def change_happiness(amount, print_msg=False):
global happiness
happiness += amount
happiness = max(0, min(happiness, 100))
if print_msg:
print(happiness,'% happy')
def die():
global b
b = "quit"
time.sleep(5)
def tick_time():
global clkhr, apm, clkday
clkhr += 1
if clkhr == 12:
if apm == 'pm':
clkday += 1
apm = 'am'
print(f'day: {clkday}')
elif apm == 'am':
apm = 'pm'
if clkhr > 12:
clkhr = 1
def change_hunger(amount):
global hunger
hunger += amount
hunger = max(0, min(hunger, 100))
if hunger < 0:
print("You starved to death.")
die()
elif hunger <= 10:
print("You are starving!")
def change_weather():
global weather
if weather != 'rain':
if random.randint(1, 10) == 1:
print('RAIN!')
weather = 'rain'
else:
if random.randint(1, 100) <= 40:
weather = 'dry'
print("It is no longer raining")
if weather == 'rain':
change_happiness(random.randint(-10, 5))
else:
change_happiness(random.randint(-1, 10))
while b != 'quit':
homeshop = 0
park = 0
work = 0
tick_time()
print(f'You live in a {home}')
print(f'Current location: In your {home}')
print(f'{clkhr}:00 {apm}')
print(f'weather: {weather}')
b = input('...') #at home
change_weather()
apples += random.randrange(7)
carrot += random.randrange(5)
microwave += random.randrange(2)
burger += random.randrange(2)
pricemicro = int(random.uniform(59.99, 119.99) * 100) / 100.0
pricebur = int(random.uniform(3.69, 4.99) * 100) / 100.0
pricecrrts = int(random.uniform(0.99, 1.59) * 100) / 100.0
priceaple = int(random.uniform(0.75, 1.29) * 100) / 100.0
change_hunger(-random.randrange(3))
pricefr = priceaple + pricecrrts
market = 'open'
microtime = 0
working = 0
walking = 0
pricemicro1 = 0
if random.randint(1, 20) == 1:
print('RAINBOW')
change_happiness(100, True)
time.sleep(1)
if random.randint(1, 10) == 1:
print('OH, look a penny!')
money += 0.01
change_happiness(5, True)
time.sleep(1)
if shoe == 1:
money += 0.50
if (apm == 'am' and clkhr <= 7) or (apm == 'pm' and clkhr >= 9):
market = 'closed'
if random.randint(1, 15) == 1 and home == 'tent':
print('BEAR!')
change_happiness(-40)
time.sleep(2)
print('.........')
time.sleep(2.5)
if random.randint(1, 15) == 15:
print('You were eaten by a bear!')
die()
if money <= 10:
print('Low money.You have $', money)
if b == 'sell':
print(pantry)
print(apply)
sell = input('sell what?:')
if sell in pantry:
if sell == 'apple':
pantry.remove('apple')
money += 0.75
elif sell == 'bad apple':
print("can't sell")
elif sell == 'carrots':
pantry.remove('carrots')
money += 0.99
elif sell == 'cooked carrots':
pantry.remove('cooked carrots')
money += 2.40
elif sell == 'burger':
pantry.remove('burger')
money += 3.69
elif sell == 'ok burger':
pantry.remove('ok burger')
money += 6.99
elif sell == 'microwave':
apply.remove('microwave')
money += 2.40
if b == 'walk': #<----- b is primary input.
while walking != 'go home':
market = 'open'
if apm == 'am':
if clkhr <= 7:
market = 'closed'
if apm == 'pm':
if clkhr >= 9:
market = 'closed'
change_hunger(-random.randrange(3))
change_weather()
tick_time()
print('Current location: sidewalk somewhere')
print(f'Current time: {clkhr}:00 {apm}')
walking = input('--->')
if walking == '?': #<-----HELP FOR WALK HERE!
print('Type store to go to store')
time.sleep(1)
print('Type go home to go home')
time.sleep(1)
print('Type park to go to the park')
time.sleep(1)
print('Type happiness for happy levels')
time.sleep(1)
print('Type hunger for hunger')
time.sleep(1)
if walking == 'happiness':
print(happiness, '% happy')
if walking == 'hunger':
print('hunger is at:', hunger)
if walking == 'park':
while park != 'walk':
market = 'open'
if apm == 'am':
if clkhr <= 7:
market = 'closed'
if apm == 'pm':
if clkhr >= 9:
market = 'closed'
change_hunger(-random.randrange(3))
print('Current location:', 'park')
print('Current time:', clkhr, ':00', apm)
change_weather()
print('weather', weather)
tick_time()
park = input('---')
if park == '?':
print('Type walk to go back to walking')
time.sleep(1)
print('Type happiness for happy levels')
time.sleep(1)
print('Type hunger for hunger')
time.sleep(1)
if park == 'happiness':
print(happiness, '% happy')
if park == 'hunger':
print('hunger is at:', hunger)
if walking == 'store': #store
isle = 0
payed = 'enter'
pricecrrts1 = 0
priceaple1 = 0
print('Current location:', 'store')
if money >= 0.01:
if market == 'open':
while payed != 'leave':
change_happiness(random.randint(-3, 10), True)
isle = input('Which isle:')
if isle == '?':
print('Isle 1 food..')
time.sleep(1)
#print('Isle 2 hardware..')
#time.sleep(1)
#print('Isle 3 medications..')
#time.sleep(1)
print ('Isle 4 apliances')
time.sleep(1)
print('checkout to pay and go')
time.sleep(1)
elif isle == '1':
diet = input('fr = fruits&vegis\nmeat = Meat') #for later \nbrkfst = cereal\n...
if diet == 'fr':
if money >= 0.75:
print('we have....')
time.sleep(1)
if apples >= 1:
if money >= priceaple:
print(apples, 'apple(s)$', priceaple, '...')
time.sleep(1)
if carrot >= 1:
if money >= pricecrrts:
print(carrot, 'bag(s) of Bb carrots $', pricecrrts, '...')
time.sleep(1)
pricecrrts1 = pricecrrts
fruit = input('===')
if fruit == 'apple':
if apples >= 1:
if money >= priceaple:
basket.append("apple")
priceaple1 = priceaple # apple arrives
print('Your basket contains:', basket)
apples -= 1
elif fruit == 'carrots':
if carrot >= 1:
if money >= pricecrrts:
basket.append("carrots")
pricecrrts1 = pricecrrts
carrot -= 1
print('Your basket contains:', basket)
if diet == 'meat':
if money >= 3.69:
print('we have....')
time.sleep(1)
if burger >= 1:
if money >= pricebur:
print(burger, 'burger(s)(uncooked)(per pound)$', pricebur, '...')
time.sleep(1)
#if carrot > =1:
#if money >= pricecrrts:
#print(carrot, 'bag(s) of Bb carrots $', pricecrrts, '...')
#time.sleep(1)
#pricecrrts1 = pricecrrts
me = input('===')
if me == 'burger':
if burger >= 1:
if money >= pricebur:
basket.append("burger")
pricebur1 = pricebur # apple arrives
print('Your basket contains:', basket)
burger -= 1
#elif fruit == 'carrots':
#if carrot >= 1:
#if money >= pricecrrts:
#basket.append("carrots")
#pricecrrts1 = pricecrrts
#orange = carrot - 1
#carrot = orange
#print('Your basket contains:', basket)
elif isle == '4':
if money >= 59.99:
print('We have.....')
time.sleep(1)
if microwave >= 1:
if money >= 59.99:
print(microwave, 'microwave(s)$', pricemicro)
time.sleep(1)
whirlpool = input('===')
if whirlpool == 'microwave':
if money >= pricemicro:
basket.append("microwave")
pricemicro1 = pricemicro # apple arrives
print('Your basket contains:', basket)
microwave -= 1
elif isle == 'checkout':
print(basket)
payit = input('Do you want to buy these:yes/no\n')
if payit == 'yes':
pricebur1 = 0
priceaple1 = 0
pricecrrts1 = 0
pricemicro1 = 0
while 'apple' in basket:
checkpriceaple = priceaple1
basket.remove('apple')
pantry.append("apple")
priceaple1 = priceaple1 + priceaple
#if 'apple' in basket:
#priceaple1 = priceaple1-priceaple #probalem to high price
while 'carrots' in basket:
checkpricecrrts = pricecrrts1
basket.remove('carrots')
pantry.append("carrots")
pricecrrts1 = pricecrrts + pricecrrts1
while 'microwave' in basket:
checkpricemicro = pricemicro1
basket.remove('microwave')
apply.append("microwave")
pricemicro1 = pricemicro1 + pricemicro
while 'burger' in basket:
checkpricebur = pricebur1
basket.remove('burger')
pantry.append("burger")
pricebur1 = pricebur1 + pricebur
if pricecrrts1 >= 0.01:
pricecrrts1 = pricecrrts1 - pricecrrts
if priceaple1 >= 0.01:
priceaple1 = priceaple1 - priceaple #fixed probalem to high price
if pricemicro1 >= 0.01:
pricemicro1 = pricemicro1 - pricemicro
if pricebur1 >= 0.01:
pricebur1 = pricebur1 - pricebur
totalprice = pricecrrts1 + priceaple1 + pricemicro1 + pricebur1
print('$', totalprice)
money -= totalprice
print('Have a nice day.\nYou have $', money)
basket.clear()
payed = 'leave'
else :
reciept = 0
payed = ('leave')
print('Have a nice day.')
if 'microwave' in basket:
microwave -= 1
if 'apple' in basket:
apples -= 1
if 'carrots' in basket:
carrot -= 1
if 'burger' in basket:
burger -= 1
while 'apple' in basket:
basket.remove('burger')
burger += 1
while 'apple' in basket:
basket.remove('apple')
apples += 1
while 'carrots' in basket:
basket.remove('carrots')
carrot += 1
while 'microwave' in basket:
basket.remove('microwave')
microwave += 1
if b == 'eat':
print(pantry)
mmm = input('What to eat?\n')
if mmm == 'apple':
if 'apple' in pantry:
change_hunger(5)
pantry.remove('apple')
print('Your hunger is at', hunger)
if mmm == 'bad apple':
if 'bad apple' in pantry:
change_hunger(-5)
pantry.remove('bad apple')
print('you lose 5 hunger')
print('Your hunger is at', hunger)
if mmm == 'carrots':
if 'carrots' in pantry:
change_hunger(5)
pantry.remove('carrots')
print('Your hunger is at', hunger)
if mmm == 'cooked carrots':
if 'cooked carrots' in pantry:
change_hunger(10)
pantry.remove('cooked carrots')
print('Your hunger is at', hunger)
if mmm == 'burger':
if 'burger' in pantry:
change_hunger(-2)
pantry.remove('burger')
print('EW!\nLOSE 2 HUNGER!')
print('Your hunger is at', hunger)
if mmm == 'ok burger':
if 'ok burger' in pantry:
change_hunger(20)
pantry.remove('ok burger')
print('Your hunger is at', hunger)
if b == '?':
print("Type quit to quit, but please don't")
time.sleep(1)
print('Type rtime for real time')
time.sleep(1)
print('Type $ for money')
time.sleep(1)
print('Type hunger for, of course, hunger')
time.sleep(1)
print('Type store to go to store. Sorry must walk to go to store')
time.sleep(1)
print('Type walk to go for a walk')
time.sleep(1)
print('Type versions for previous versions')
time.sleep(1)
print('Type job for joby stuff')
time.sleep(1)
print('Type real estate for home info')
time.sleep(1)
print('Type use to use items')
time.sleep(1)
print('Type happiness to see happiness')
time.sleep(1)
if b == 'happiness':
print(happiness, '% happy')
if b == 'rtime':
print(strftime("Current time is %a, %d %b %Y %I:%M:%S", gmtime()))
time.sleep(3)
if b == 'use':
if home!= 'tent':
print(apply)
user = input('use:')
if user == 'microwave':
if 'microwave' in apply:
print(pantry)
usemicro = input('cook:')
if usemicro == 'carrots':
microwave(30, "carrots", "cooked carrots")
elif usemicro == 'burger':
microwave(30, "burger", "ok burger")
elif usemicro == 'apple':
microwave(30, "apple", "bad apple")
if b == 'versions':
print('1.0:The original')
time.sleep(1)
print('1.1:The tent update')
time.sleep(1)
print('1.2:The clock update')
time.sleep(1)
print('1.3:The work update')
time.sleep(1)
print('1.4:The house update')
time.sleep(1)
print('1.5:The happiness update')
time.sleep(1)
print('1.6:Undocumented update')
time.sleep(1)
print('1.7:The 1163 lines of code update')
time.sleep(1)
print('1.7.1:Universal update')
if b == '$':
print("You have $", money)
time.sleep(1)
if b == 'hunger':
print('hunger is', hunger)
if b == 'real estate':
while homeshop != 'go home':
print('Current location:', 'real estate office.')
homeshop = input('===')
if homeshop == '?':
print('Type search to look for homes.')
time.sleep(1)
print("Type info for home info")
time.sleep(1)
print("Type sell to sell home")
time.sleep(1)
if homeshop == 'sell':
if home == 'Log cabin':
selllc = input('do you want to sell this Log cabin worth $140999 yes/no:')
if selllc == 'yes':
home = 'tent'
logcbn = 0
money += 140099
if home == 'Ranch Home':
sellrh = input('do you want to sell this Ranch home worth $70999 yes/no:')
if sellrh == 'yes':
home = 'tent'
rnchhome = 0
money += 70099
if home == 'Mobile home':
sellmh = input('do you want to sell this Mobile home worth $9099 yes/no:')
if sellmh == 'yes':
home = 'tent'
mblhome = 0
money += 9099
if homeshop == 'info':
print('you live in a:', home)
if home == 'Log cabin':
print('worth $150000')
if home == 'Ranch Home':
print('worth $80000')
if home == 'Mobile home':
print('worth $10000')
if homeshop == 'search':
if mblhome == 0:
print('mobile home $10000')
time.sleep(1)
if rnchhome == 0:
print('ranch home $80000')
time.sleep(1)
if logcbn == 0:
print ('log cabin $150000')
time.sleep(1)
pckone = input('***')
if pckone == 'log cabin':
if money >= 150000:
if logcbn == 0:
if mblhome == 0:
if rnchhome == 0:
sure = input('are you sure?yes/no:')
if sure == 'yes':
money -= 150000
home = 'Log cabin'
logcbn = 1
if pckone == 'ranch home':
if money >= 80000:
if rnchhome == 0:
if mblhome == 0:
if logcbn == 0:
sure = input('are you sure?yes/no:')
if sure == 'yes':
money -= 80000
home = 'Ranch Home'
rnchhome = 1
if pckone == 'mobile home':
if money >= 10000:
if mblhome == 0:
if rnchhome == 0:
if logcbn == 0:
sure = input('are you sure?yes/no:')
if sure == 'yes':
money -= 10000
home = 'Mobile home'
mblhome = 1
if b == 'job':
while work != 'go home':
work = input('>>>')
if shoe == 0 and mc == 0:
mr = 3
if work == '?':
print('Type find job to find job.')
time.sleep(1)
print('Type view for job info.')
time.sleep(1)
print('Type go to work to work(and earn money!)')
time.sleep(1)
print('Type go home to go home')
time.sleep(1)
if work == 'find job':
print(mr, 'jobs available:')
time.sleep(1)
if shoe == 0 and mc == 0 and dq == 0:
print('shoeshinning')
time.sleep(1)
if mc == 0 and shoe == 0 and dq == 0:
print('mcducks')
time.sleep(1)
if mc == 0 and shoe == 0 and dq == 0:
print('dq need 5xp')
time.sleep(1)
if shoe == 0 and mc == 0 and dq == 0:
hire = input('---')
if hire == 'shoeshinning':
print('hired 50 cents an hour\nno need to go to work.')
shoe = 1
if hire == 'mcducks':
print('hired about $7.50 an hour\nneed to go to work')
mc = 1
if hire == 'dq':
print('hired about $10.00 an hour\nneed to go to work')
dq = 1
if work == 'view':
if mc == 1:
print('You are an cashier at mcducks for $7.50 an hour')
if shoe == 1:
print('You shoe shine for $0.50 an hour')
if work == 'go to work':
if mc == 1:
while working != 'stop':
print('Current location:', 'mcducks')
working = input('...')
jobevent = random.randint(1,10)
clkhr += 1
if clkhr == 11:
if apm == 'pm':
clkday += 1
xxp += 1
apm = 'am'
print('day:', clkday)
if xxp >= 7:
xp += 1
xxp = 0
elif apm == 'am':
apm = 'pm'
if clkhr == 12:
clkhr = 0
change_happiness(random.randint(-3, 10), True)
if happiness <= 10:
money += int(random.uniform(0.01, 0.50) * 100) / 100.0
elif happiness <= 20:
money += int(random.uniform(0.50, 1.00) * 100) / 100.0
elif happiness <= 30:
money += int(random.uniform(1.00, 1.50) * 100) / 100.0
elif happiness <= 40:
money += int(random.uniform(1.50, 2.00) * 100) / 100.0
elif happiness <= 50:
money += int(random.uniform(2.00, 2.50) * 100) / 100.0
elif happiness <= 60:
money += int(random.uniform(2.50, 3.00) * 100) / 100.0
elif happiness <= 70:
money += int(random.uniform(3.00, 3.50) * 100) / 100.0
elif happiness <= 80:
money += int(random.uniform(3.50, 4.00) * 100) / 100.0
elif happiness <= 90:
money += int(random.uniform(4.00, 7.49) * 100) / 100.0
elif happiness <= 100:
money += 7.50
hunger -= random.randrange(6)
print('you have $', money)
time.sleep(0.5)
if working == '?':
print('Type eat to eat')
time.sleep(1)
print('Type stop to (you know) stop working')
time.sleep(1)
if working == 'eat':
print('Choices:bigquack,lil burger,chicknuggets (6 pc)')
mcyds = input('Eat what?')
if mcyds == 'bigquack':
money -= 2.60
hunger += 10
if mcyds == 'lil burger':
money -= 2.20
hunger += 9
if mcyds == 'chicknuggets':
money -= 1.40
hunger += 6
tick_time()
if jobevent == 1:
jobprblm = input('Someone orderd a blizzard\ndo you:\na:Tell them we do not have that and offer something else?\nb:Send them to DQ?')
if jobprblm == 'a':
if random.randint(1, 2) == 1:
print('He left upset.\nYou lose $10')
money -= 10
else:
print('He orderd a bigquack.\nYou gain $10')
money += 10
else:
if random.randint(1, 2) == 1:
print('Your boss is mad.\nYou lose $10')
money -= 10
else:
print('He left happy.\nYou gain $10')
money += 10
elif dq == 1:
while working != 'stop':
print('Current location:', 'dq')
working = input('~~~')
jobevent = random.randrange(1,10)
clkhr += 1
if clkhr == 12:
if apm == 'pm':
clkday += 1
xxp += 1
apm = 'am'
print('day:', clkday)
if xxp >= 7:
xp += 2
xxp = 0
elif apm == 'am':
apm = 'pm'
if clkhr > 12:
clkhr = 1
change_happiness(random.randint(-3, 10), True)
if happiness <= 10:
money += int(random.uniform(0.01, 1.00) * 100) / 100.0
elif happiness <= 20:
money += int(random.uniform(1.00, 2.00) * 100) / 100.0
elif happiness <= 30:
money += int(random.uniform(2.00, 3.00) * 100) / 100.0
elif happiness <= 40:
money += int(random.uniform(3.00, 4.00) * 100) / 100.0
elif happiness <= 50:
money += int(random.uniform(4.00, 5.00) * 100) / 100.0
elif happiness <= 60:
money += int(random.uniform(5.00, 6.00) * 100) / 100.0
elif happiness <= 70:
money += int(random.uniform(6.00, 7.00) * 100) / 100.0
elif happiness <= 80:
money += int(random.uniform(7.00, 8.00) * 100) / 100.0
elif happiness<=90:
money += int(random.uniform(8.00, 9.00) * 100) / 100.0
elif happiness <= 100:
money += 10.00
hunger -= random.randrange(6)
print('you have $', money)
time.sleep(0.5)
if working == '?':
print('Type eat to eat')
time.sleep(1)
print('Type stop to (you know) stop working')
time.sleep(1)
if working == 'eat':
print('Choices:blizzard,dq burger,chicktenders (6 pc)')
mcyds = input('Eat what?')
if mcyds == 'blizzard':
money -= 2.50
change_hunger(8)
if mcyds == 'dq burger':
money -= 2.20
change_hunger(12)
if mcyds == 'chicktenders':
money -= 1.40
change_hunger(7)
tick_time()
if jobevent == 1:
jobprblm = input('Someone orderd a big quack\ndo you:\na:Tell them we do not have that and offer something else?\nb:Send them to Mcducks?')
if jobprblm == 'a':
if random.randint(1, 2) == 1:
print('He left upset.\nYou lose $20')
money -= 20
else:
print('He orderd a blizzzard.\nYou gain $20')
money += 20
else:
if random.randint(1, 2) == 1:
print('Your boss is mad.\nYou lose $20')
money -= 20
else:
print('He left happy.\nYou gain $20')
money += 20
if os.name == 'nt':
# Play Windows exit sound.
winsound.PlaySound("SystemExit", winsound.SND_ALIAS)