-
Notifications
You must be signed in to change notification settings - Fork 0
/
TarotApp1.swift
188 lines (182 loc) · 3.74 KB
/
TarotApp1.swift
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
//Major arcana tarot app
// Switch challenge
var Name: String = "Noelle"
var Question: String = " How I am doing generally?🤔"
var randomNumber = Int.random(in: 1...22)
var randomNum = Int.random(in: 1...40)
var TarotCard: String
var MinorCard: String
// switch statement used to randomly go through each card
switch randomNumber{
case 1:
TarotCard = "The Fool"
case 2:
TarotCard = "The Magican"
case 3:
TarotCard = "The High Priestess"
case 4:
TarotCard = "The Empress"
case 5:
TarotCard = "The Emperor"
case 6:
TarotCard = "The Hierophant"
case 7:
TarotCard = "The Lovers"
case 8:
TarotCard = "The Chariot"
case 9:
TarotCard = "Strength"
case 10:
TarotCard = "The Hermit"
case 11:
TarotCard = "The Wheel of Fortune"
case 12:
TarotCard = "Justice"
case 13:
TarotCard = "The Hanged Man"
case 14:
TarotCard = "Death"
case 15:
TarotCard = "Temperance"
case 16:
TarotCard = "The Devil"
case 17:
TarotCard = "The Tower"
case 18:
TarotCard = "The Star"
case 19:
TarotCard = "The Moon"
case 20:
TarotCard = "The Sun"
case 21:
TarotCard = "Judegment"
case 22:
TarotCard = "The World"
default:
TarotCard = "What is your question?"
}
// working on shorting this code
switch randomNum{
case 1:
MinorCard = "Ace of Pentcales"
case 2:
MinorCard = "2 of Pentcales"
case 3:
MinorCard = "3 of Pentcales"
case 4:
MinorCard = "4 of Pentcales"
case 5:
MinorCard = "5 of Pentcales"
case 6:
MinorCard = "6 of Pentcales"
case 7:
MinorCard = "7 of Pentcales"
case 8:
MinorCard = "8 of Pentcales"
case 9:
MinorCard = "9 of Pentcales"
case 10:
MinorCard = "10 of Pentcales"
case 11:
MinorCard = "Ace of Cups"
case 12:
MinorCard = "1 of Cups"
case 13:
MinorCard = "2 of Cups"
case 14:
MinorCard = "3 of Cups"
case 15:
MinorCard = "4 of Cups"
case 16:
MinorCard = "5 of Cups"
case 17:
MinorCard = "6 of Cups"
case 18:
MinorCard = "7 of Cups"
case 19:
MinorCard = "8 of Cups"
case 20:
MinorCard = "9 of Cups"
case 21:
MinorCard = "Ace of Wands"
case 22:
MinorCard = "2 of Wands"
case 23:
MinorCard = "3 of Wands"
case 24:
MinorCard = "4 of Wands"
case 25:
MinorCard = "5 of Wands"
case 26:
MinorCard = "6 of Wands"
case 27:
MinorCard = "7 of Wands"
case 28:
MinorCard = "8 of Wands"
case 29:
MinorCard = "9 of Wands"
case 30:
MinorCard = "10 of Wands"
case 31:
MinorCard = "Ace of Swords"
case 32:
MinorCard = "2 of Swords"
case 33:
MinorCard = "3 of Swords"
case 34:
MinorCard = "4 of Swords"
case 35:
MinorCard = "5 of Swords"
case 36:
MinorCard = "6 of Swords"
case 37:
MinorCard = "7 of Swords"
case 38:
MinorCard = "8 of Swords"
case 39:
MinorCard = "9 of Swords"
case 40:
MinorCard = "10 of Swords"
case 41:
MinorCard = "King of Swords"
case 42:
MinorCard = "Queen of Swords"
case 43:
MinorCard = "Kight of Swords"
case 44:
MinorCard = "Princess of Swords"
case 45:
MinorCard = "King of Wands"
case 46:
MinorCard = "Queen of Wands"
case 47:
MinorCard = "Kight of Wands"
case 48:
MinorCard = "Princess of Wands"
case 49:
MinorCard = "King of Cups"
case 50:
MinorCard = "Queen of Cups"
case 51:
MinorCard = "Kight of Cups"
case 52:
MinorCard = "Princess of Cups"
case 53:
MinorCard = "Kight of Pentacles"
case 54:
MinorCard = "Princess of Pentacles"
case 55:
MinorCard = "King of Pentacles"
case 56:
MinorCard = "Queen of Pentacles"
default:
MinorCard = "what is your question?"
}
//this was for challenge on codecademy
if Name.isEmpty {
print("asked:\(Question)")
print("Answer: \(TarotCard) and \(MinorCard)")
} else{
print("\(Name) asked:\(Question)")
print("Answer: \(TarotCard) and \(MinorCard)")
}