-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJokeService.cs
203 lines (201 loc) · 5.44 KB
/
JokeService.cs
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
using System;
using System.Collections.Generic;
using System.Linq;
namespace DadJokes
{
public class JokeService : IJokeService
{
public Joke getRandomJoke()
{
return _jokes.ToArray()[(int)DateTime.Now.Ticks % _jokes.Count()];
}
private readonly IEnumerable<Joke> _jokes = new[]
{
new Joke
{
Question = "What diet did the ghost developer go on?",
Answer = "Boolean"
},
new Joke
{
Question = "Why was the developer unhappy at his job?",
Answer = "He wanted arrays."
},
new Joke
{
Question = "Why did 10 get paid less than \"10\"?",
Answer = "There was workplace inequality."
},
new Joke
{
Question = "Why was the function sad after a successful first call?",
Answer = "He didn’t get a callback."
},
new Joke
{
Question = "Why did the angry function exceed the callstack size?",
Answer = "He got into an Argument with himself"
},
new Joke
{
Question = "Whats the object-oriented way to become wealthy?",
Answer = "Inheritance"
},
new Joke
{
Question = "Why did the developer ground his daughter?",
Answer = "She wasn't telling the truthy"
},
new Joke
{
Question = "What did the array say after it was extended?",
Answer = "Stop objectifying me."
},
new Joke
{
Question = "!false",
Answer = "It's funny 'cause it's true."
},
new Joke
{
Question = "Where did the parallel function wash its hands?",
Answer = "Async"
},
new Joke
{
Question = "I'm starting a band called HTML Encoder",
Answer = "Looking to buy a guitar &"
},
new Joke
{
Question = "Why did the functions stop calling each other?",
Answer = "Because they had constant arguments."
},
new Joke
{
Question = "What's the second movie about a database engineer called?",
Answer = "The SQL."
},
new Joke
{
Question = "A programmer's wife tells them, \"Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.\"",
Answer = "The programmer comes home with 12 loaves of bread."
},
new Joke
{
Question = "What did the spider do on the computer?",
Answer = "Made a website!"
},
new Joke
{
Question = "What did the computer do at lunchtime?",
Answer = "Had a byte!"
},
new Joke
{
Question = "What does a baby computer call his father?",
Answer = "Data!"
},
new Joke
{
Question = "Why did the computer keep sneezing?",
Answer = "It had a virus!"
},
new Joke
{
Question = "What is a computer virus?",
Answer = "A terminal illness!"
},
new Joke
{
Question = "Why was the computer cold?",
Answer = "It left its Windows open!"
},
new Joke
{
Question = "Why was there a bug in the computer?",
Answer = "Because it was looking for a byte to eat"
},
new Joke
{
Question = "Why did the computer squeak?",
Answer = "Because someone stepped on it's mouse!"
},
new Joke
{
Question = "What do you get when you cross a computer and a life guard?",
Answer = "A screensaver!"
},
new Joke
{
Question = "Where do all the cool mice live?",
Answer = "In their mousepads!"
},
new Joke
{
Question = "What do you get when you cross a computer with an elephant?",
Answer = "Lots of memory!"
},
new Joke
{
Question = "Java truly is an OOP language...",
Answer = "As in: OOPs I used Java!"
},
new Joke
{
Question = "How do programming pirates pass method parameters?",
Answer = "Varrrrarrrgs."
},
new Joke
{
Question = "How do programming shepherds count their flock?",
Answer = "With lambda functions"
},
new Joke
{
Question = "How did pirates collaborate before computers ?",
Answer = "Pier to pier networking."
},
new Joke
{
Question = "Why don't bachelors like Git?",
Answer = "Because they are afraid to commit."
},
new Joke
{
Question = "A SQL query goes into a bar, walks up to two tables and asks:",
Answer = "Can I JOIN you?"
},
new Joke
{
Question = "[\"hip\",\"hip\"]",
Answer = "(hip hip array!)"
},
new Joke
{
Question = "Why was the developer's family upset with them at dinner?",
Answer = "They forgot to git squash before going home"
},
new Joke
{
Question = "What did JavaScript call his son?",
Answer = "JSON!"
},
new Joke
{
Question = "What did the proud React component say to its child?",
Answer = "I've got to give you props"
},
new Joke
{
Question = "What did the server say to his client who was having a bad day?",
Answer = "Everything's going to be 200"
},
new Joke
{
Question = "Why did the developer go broke?",
Answer = "Because he used up all his cache"
}
};
}
}