Skip to content

Instantly share code, notes, and snippets.

@yuku
Created June 13, 2013 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuku/5774786 to your computer and use it in GitHub Desktop.
Save yuku/5774786 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
SENTENCES = [
# 1
'Once you see all those animals, you should feel better.',
'I need to fix my car as soon as possible.',
'I hope it snows all day long tomorrow.',
'Can I get you anything?',
'How many apples did you eat today?',
"If it is possible, I'd like to have a Diet Coke.",
'Whose cellular phone is this anyway?',
'Richard, what are you doing up there?',
"Who is that? To tell the truth, I don't like him that much.",
"One should keep one's promise; otherwise no one will trust him or her.",
# 2
"Speaking of the tennis match, this is John's last one of the season.",
'Do you know how to cook this?',
'I feel sick to my stomach.',
'Feel free to call me, whenever you want to play tennis.',
'I have two sisters, and both of them are sick. To make matters worse, they have to take their final exams this week',
'How come you are not wearing a yellow uniform today?',
'I hae to make a decision by 10:30.',
'How often do you play tennis?',
'Do you mind if I give you some advice on that? It is a very important tip on how to use the court.',
'You are much better than me.',
# 3
"I can't believe this is the last summer camp that I am attending with you guys.",
"There's some food on the table. Help yourself, but please don't feed the dog. We are trying to cut down the food cost.",
'Is there a drugstore around here?',
"Don't tell me you can't go there.",
'You should call the doctor right away.',
'Would you bring more batteries for me?',
"May I ask you where I can find those batteries? I looked around everywhere but I couldn't find them. Where did you put them?",
'What is going on down there?',
'I had a hard time controlling the boat.',
"Please forgive me this time. I will make sure it won't happen again.",
# 4
'On a day like this, I would do anything for a cold drink.',
'What are you looking at?',
'I heard you are moving to New York. Is that right?',
'Is this the ring you were looking for?',
'How much did you par for that?',
'How do you open this door?',
'I hate this. This kind of thing makes me really angry.',
"We are very sorry for all the trouble we've caused you, but that's the way it is around here. Take it or leave it.",
'Excuse me. How long will it take to fix it?',
'Oh my gosh! What a mess! What happened here?',
# 5
"John promised to visit Paul's office before he leaves for Egypt.",
'Let me know when she comes in.',
"Why don't you give her a call and remind her that I'll stop by around9?",
'I wonder if this pearl necklace will make her happy.',
'Are you surprised at the news?',
'Do you want me to verify that for you?',
"It was here on the table this morning but it's gone now.",
"It's obvious he failed the exam twice before he became a broadcaster.",
"The reason why he failed the exam was he simply didn't study hard enough.",
"If he studies hard, he will pass the exam. That's for sure.",
]
arr = SENTENCES.shuffle[0..2]
num = SENTENCES.index(arr[0])
arr.shuffle!
puts <<"EOS"
The sentence of ##{num} is...
1. #{arr[0]}
2. #{arr[1]}
3. #{arr[2]}
EOS
line = gets.strip
if line =~ /^\d+$/ && arr[line.to_i - 1] == SENTENCES[num]
puts 'Good job!'
exit 0
else
puts "##{num} is \"#{SENTENCES[num]}\""
exit 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment