repl.it
@JamesMacdonald1/

Project 8 - Final Project-6

Python

No description

fork
loading
Files
  • main.py
main.py
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
# Intro to Computer Science: Final Project Template
def choose_cake():
	global recipe
	recipe = {}
	wat = input("  which cake would you like to make, vanilla or strawberry?")
	if wat == 'vanilla':
		recipe = 1
		return True
	elif wat == 'strawberry':
		recipe = 2
		return True
	else:
		print("that doesn't make sense to me")
		return False

def mixing_grades(mixies, answers):
	global mix_score
	mix_score = {}
	if mixies[0] ==answers[0] and mixies[1] ==answers[1] and mixies[2] ==answers[2] and mixies[3] ==answers[3]:
		print("great job following the recipe!")
		mix_score = 4
	elif (mixies[0]!=answers[0] and mixies[1]==answers[1] and mixies[2]==answers[2] and mixies[3]==answers[3])or(mixies[0]==answers[0] and mixies[1]!=answers[1] and mixies[2]==answers[2] and mixies[3]==answers[3])or(mixies[0]==answers[0] and mixies[1]==answers[1] and mixies[2]!=answers[2] and mixies[3]==answers[3])or(mixies[0]==answers[0] and mixies[1]==answers[1] and mixies[2]==answers[2] and mixies[3]==answers[3]):
		print("you didn't quite follow the recipe, but that's ok")
		mix_score = 3
	elif (mixies[0]==answers[0] and mixies[1]==answers[1]) or (mixies[0]==answers[0] and mixies[2]==answers[2]) or (mixies[0]==answers[0] and mixies[3]==answers[3]) or (mixies[1]==answers[1] and mixies[2]==answers[2]) or (mixies[1]==answers[1] and mixies[3]==answers[3]) or (mixies[2]==answers[2] and mixies[3]==answers[3]):
		print("ok, so you got a few ingredients wrong ...")
		mix_score = 2
	elif mixies[0]==answers[0] or mixies[1]==answers[1] or mixies[2]==answers[2] or mixies[3]==answers[3]:
		print("the mixture seems a little off")
		mix_score = 1
	else:
		print("I think this cake has gone wrong :(")
		mix_score = 0


def baking_trivia():
	global bakescore
	bakescore = 0
	qu1a = input("which contains more calcium, a; milk, or b; orange juice?: ")
	if qu1a == trivia_questions['qu1']:
		bakescore = 1
	print(bakescore)
	qu2a = input("what vitamin helps you heal cuts and bruises, a, b, or c?: ")
	if qu2a == trivia_questions['qu2']:
		bakescore = bakescore + 1
	qu3a = input("How much water should you drink in a day? a; 8 glasses or b; as much as you feel you need: ")
	if qu3a == trivia_questions['qu3']:
		bakescore = bakescore + 1
	
def FINAL_RESULT():
	finalscore = (mixin + bakescore)
	print(finalscore)
	if finalscore == 11:
		print("This cake is perfect!")
	elif finalscore > 9:
		print("This cake tastes really good")
	elif finalscore > 6:
		print("Looks like you could use some practice")
	else:
		print("We'll make a better one next time")
	


trivia_questions = {
	'qu1' : 'a',
	'qu2' : 'c',
	'qu3' : 'b',
	'qu4' : 'd',
}

playing = True
print("Hello, Do you want to bake a cake? You can make two types of cake,  testing your math skills and baking knowledge on the way, vanilla is  reccomended for new users, it works as a tutorial")
print("choose a cake, remember, spelling matters!")

vanilla_cake_stuff = '''       ingredients:
2 sticks of unsalted butter
3 cups of all purpose flour
1 tablespoon of baking powder
1/2 teaspoon of salt
1 and 1/4 cup of sugar
4 large eggs
1 tablespoon of vanilla extract
1 cup milk '''

strawberry_cake_stuff = ''' ingredients:
3/4 cup of fresh strawberries
2 and 1/4 cups of all cake flour
2 and 1/2 teaspoons of baking powder
1/4 teaspoon of salt
1 teaspoon of vanilla extract
1/2 cup of unsalted butter
1 and 1/2 cups of sugar
2 large eggs'''

#mainloop


while playing:
	if choose_cake() == True:
		if recipe == 1:
			print("that's great! vanilla is my favorite! to make it we need these "+vanilla_cake_stuff+". We are lucky, we have plenty of these ingredients, let's mix the wet ones first")
			mixies = [0,1,2,3]
			answers = ['2','4','1','1']
			mixies[0] = input("how many sticks of unsalted butter do we need?")
			mixies[1] = input("how many large eggs do we need?")
			mixies[2] = input("how many tablespoons of vanilla extract do we need?")
			mixies[3] = input("how many cups of milk do we need?")
			mixing_grades(mixies, answers)
			print(mix_score)
			mixin = int(mix_score)
			print("now let's add the dry ingredients together")
			mixies = [0,1,2,3]
			answers = ['3','1','1','5']
			mixies[0] = input("how many cups of all purpose flour do we need?")
			mixies[1] = input("how many tablespoons of baking powder do we need?")
			mixies[2] = input("how many half teaspoons of salt do we need")
			mixies[3] = input("how many fourth cups of sugar do we need?")
			mixing_grades(mixies, answers)
			mixin = mixin + int(mix_score)
			print("now we are going to bake the cake! please answer some questions for me")
			baking_trivia()
			print("let's take it out of the oven now")
			FINAL_RESULT()

		elif recipe == 2:
			print("that's great! strawberry is my favorite! to make it we need these "+strawberry_cake_stuff+". We will have to double this recipe,  can you do that? Lets's mix the wet ingredients first")
			mixies = [0,1,2,3]
			answers = ['3','1','2','4']
			mixies[0] = input("how many half cups of strawberries do we need?")
			mixies[1] = input("how many cups of unsalted butter do we need?")
			mixies[2] = input("how many teaspoons of vanilla do we need?")
			mixies[3] = input("how many large eggs do we need?")
			mixing_grades(mixies, answers)
			print(mix_score)
			mixin = int(mix_score)
			print("now let's add the dry ingredients together")
			mixies = [0,1,2,3]
			answers = ['9','5','1','3']
			mixies[0] = input("how many half cups of cake flour do we need?")
			mixies[1] = input("how many teaspoons of baking powder do we need?")
			mixies[2] = input("how many half teaspoons of salt do we need")
			mixies[3] = input("how many cups of sugar do we need?")
			mixing_grades(mixies, answers)
			mixin = mixin + int(mix_score)
			print("now we are going to bake the cake! please answer some questions for me")
			baking_trivia()
			print("let's take it out of the oven now")
			FINAL_RESULT()
		
?