# JokesManager.ipynb

In [1]:
from xv.english.fun import JokesManager

In [2]:
ke = JokesManager()

In [3]:
ke.printProblemTypes()

0. _problem_fill_in_the_blanks_question
1. _problem_interchanged_words
2. _problem_put_letters_in_order
3. _problem_put_sentence_in_order
4. _problem_put_paragraph_in_order
5. _problem_insert_a_sentence

In [4]:
ke.getRandomProblem(problem_type = 0)

Out[4]:
Fill in the blanks with the given words. Change the form of words if necessary.
with, into, from, for
"Sounds great," said the health-conscious boy. He ordered some.
He watched as the cook pulled a basket of fries __________ the fryer. The potatoes were dripping __________ oil when the cook put them __________ the container.
"Wait a minute," the boy said. "Those don't look fat-free."
"Sure they are," the cook said. "We charge only __________ the potatoes. The fat is free!"
with, into, from, for
In [5]:
ke.printAnswer()

Out[5]:
"Sounds great," said the health-conscious boy. He ordered some.
He watched as the cook pulled a basket of fries from the fryer. The potatoes were dripping with oil when the cook put them into the container.
"Wait a minute," the boy said. "Those don't look fat-free."
"Sure they are," the cook said. "We charge only for the potatoes. The fat is free!"
In [6]:
ke.printSolution()

Out[6]:
"Sounds great," said the health-conscious boy. He ordered some.
He watched as the cook pulled a basket of fries from the fryer. The potatoes were dripping with oil when the cook put them into the container.
"Wait a minute," the boy said. "Those don't look fat-free."
"Sure they are," the cook said. "We charge only for the potatoes. The fat is free!"
In [ ]:


In [7]:
from IPython.display import HTML
n = len(ke._problemTemplates)
max_loop = 1
for j in range(0, max_loop):
for i in range(n):
problem_type = i
display(HTML(f"<h2>problem_type: {problem_type}/{n-1} (loop {j}/{max_loop-1})</h2>"))
ke.getRandomProblem(problem_type = problem_type, verbose = True)
display(ke.printProblem())

display(HTML(f"<h6>Solution:</h6>"))
display(ke.printSolution())
pass


## problem_type: 0/5 (loop 0/0)

Problem Template: _problem_fill_in_the_blanks_question

Fill in the blanks with the given words. Change the form of words if necessary.
you, we, me, he
A guy walks into the local welfare office, marches straight up to the counter and says, "Hi . . You know what, I just HATE drawing welfare I would really rather have a job." The social worker behind the counter says, "Your timing is excellent. We just got a job opening from a very wealthy old man who wants a chauffeur / bodyguard for his 18-year-old nymphomaniac daughter. You will have to drive around in his Mercedes, and he'll supply all of your clothes. Because of the long hours, meals will be provided. You'll be expected to escort her on her overseas holiday trips. You'll have an adjoining room. The starting salary is \$200,000 a year." The guy says, "You're bullshitting me!" The social worker says, "Yeah, well, you started it." ## problem_type: 1/5 (loop 0/0) Problem Template: _problem_interchanged_words  The words have been interchanged. Please put them in proper places. potatoes, bottles, loaves, cameras When I was a boy, my momma would send me down to a corner store with \$1 and I'd come back with 5 potatoes, 2 cameras of bread, 3 loaves of milk, a hunk of cheese, a box of tea and 6 eggs. You can't do that now. Too many security bottles.
potatoes, bottles, loaves, cameras

## problem_type: 2/5 (loop 0/0)

Problem Template: _problem_put_letters_in_order

Unscramble the word:
asys

The word has been taken from the following paragraph:
"I charge \$50 for three questions," the lawyer says. "That's awfully steep, isn't it?" the guy asks. "Yes, I suppose so," the lawyer replies. "Now what's your final question?" ###### Answer: says ###### Solution: says A guy asks a lawyer about his fees. "I charge \$50 for three questions," the lawyer says.
"That's awfully steep, isn't it?" the guy asks.
"Yes, I suppose so," the lawyer replies. "Now what's your final question?"

## problem_type: 3/5 (loop 0/0)

Problem Template: _problem_put_sentence_in_order

Sort the following into a meaningful sentence:
1. this parrot
2. was a
3. very nasty
4. parrot
This parrot was a very nasty parrot.
###### Solution:
This parrot was a very nasty parrot.

## problem_type: 4/5 (loop 0/0)

Problem Template: _problem_put_paragraph_in_order

Sort the sentences into a meaningful order:
1. Nearing a bar, she saw a large, disreputable-looking man step outside.
2. Although the nun very much disapproved of overindulging in drink, she decided that this time, discretion was the better part of valor.
3. He began walking towards her, clearly swaying as a result of the many drinks he had undoubtedly just consumed.
4. A nun found herself walking through a questionable neighborhood one night on her way back to the convent.
5. Suddenly, the man hauled back and punched her in the face.
6. As she fell back in shock and pain, he threw another punch.
7. She smiled at him and stepped to the side to pass him.
8. And another and another.
9. The last thing she heard before she passed out: "Ya ain't shhho fuckin' tough tonight, arrrrrre ya Batman??"
A nun found herself walking through a questionable neighborhood one night on her way back to the convent. Nearing a bar, she saw a large, disreputable-looking man step outside. He began walking towards her, clearly swaying as a result of the many drinks he had undoubtedly just consumed.
Although the nun very much disapproved of overindulging in drink, she decided that this time, discretion was the better part of valor. She smiled at him and stepped to the side to pass him. Suddenly, the man hauled back and punched her in the face. As she fell back in shock and pain, he threw another punch. And another and another.
The last thing she heard before she passed out: "Ya ain't shhho fuckin' tough tonight, arrrrrre ya Batman??"
###### Solution:
A nun found herself walking through a questionable neighborhood one night on her way back to the convent. Nearing a bar, she saw a large, disreputable-looking man step outside. He began walking towards her, clearly swaying as a result of the many drinks he had undoubtedly just consumed.
Although the nun very much disapproved of overindulging in drink, she decided that this time, discretion was the better part of valor. She smiled at him and stepped to the side to pass him. Suddenly, the man hauled back and punched her in the face. As she fell back in shock and pain, he threw another punch. And another and another.
The last thing she heard before she passed out: "Ya ain't shhho fuckin' tough tonight, arrrrrre ya Batman??"

## problem_type: 5/5 (loop 0/0)

Problem Template: _problem_insert_a_sentence

Insert the sentence in the passage below. Use punctuation if needed.
The first guy wishes he was off the island and back home.

Passage
Three guys stranded on a desert island find a magic lantern containing a genie, who grants them each one wish. The second guy wishes the same. The third guy says: 'I'm lonely. I wish my friends were back here.'
Three guys stranded on a desert island find a magic lantern containing a genie, who grants them each one wish.
The first guy wishes he was off the island and back home.
The second guy wishes the same. The third guy says: 'I'm lonely. I wish my friends were back here.'
###### Solution:
Three guys stranded on a desert island find a magic lantern containing a genie, who grants them each one wish.
The first guy wishes he was off the island and back home.
The second guy wishes the same. The third guy says: 'I'm lonely. I wish my friends were back here.'
In [ ]: