-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbob.rb
162 lines (153 loc) · 4.34 KB
/
bob.rb
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
# This very non-DRY (damp?) script was written as part of a screencast video for
# my application to the Ada Developers Academy
# I wanted to create a simulation of an AI - not strictly a chat bot (I'm working on that, too),
# but something more controlled and well, scripted.
#
#
def listen()
STDIN.gets.chomp().downcase.gsub(/[^a-z\s]/, '')
end
def skip_line(n)
n.times do
puts ""
end
end
def type_string(str)
str.each_char do |c|
if c != " " or c != "." or c != ","
sleep 0.08
else
sleep 0.3
end
print c
end
print "\n"
end
def slow_scroll()
10.times do
sleep 0.05
puts ""
end
end
puts "Hi, I'm Bob."
sleep 0.2
puts "And you are...?"
response = STDIN.gets.chomp().downcase.gsub(/[^a-z\s]/, '')
if response == "Jaime" || "jaime" || "me"
skip_line 2
puts "WELCOME BACK, JAIME!"
puts ""
puts ""
puts " ** ** "
puts " * * * * "
puts " * * * * * * "
puts " * * * * "
puts " ** ** "
puts " - "
puts " * * "
puts " * * "
puts " * * * * * * * * * * "
puts " * * "
puts " * * "
puts " * * * * * * * "
puts ""
puts ""
puts "I missed you!"
listen
sleep 0.5
skip_line 2
puts "What would you like to do today?"
puts "*******************************************************************"
puts "* *"
puts "* 1. Play a game *"
puts "* *"
sleep 0.2
puts "* 2. SHUT DOWN ALL THE GARBAGE MASHERS ON THE DETENTION LEVEL! *"
puts "* *"
sleep 0.2
puts "* 3. Apply to ADA *"
puts "* *"
puts "*******************************************************************"
listen
skip_line 2
puts "You go, girl!!"
skip_line 1
sleep 0.2
puts "Ok, first question:"
skip_line 1
while true
puts "1. Why are you the best applicant for Ada?"
response = listen
skip_line 1
sleep 0.2
if !response.include? "skip"
puts "I knew you had an answer for that one."
break
end
print "Ok."
sleep 0.2
puts "We'll come back to that one later."
sleep 0.3
skip_line 2
puts "2. Taking a year off of work to learn skills for a new career will be difficult"
sleep 0.2
puts "How will you prepare for such an endeavor?"
listen
puts "\nYou know you're always going to come back t ome at night, though...\n"
listen
skip_line 1
puts "3. Why are you interested in programming?"
sleep 0.2
puts "What have you done to expose yourself to programming so far?"
sleep 0.3
puts "Aw, shucks. You're going to make me blush..."
sleep 1.0
skip_line 1
puts "Ahem"
sleep 0.5
puts "4. What are your professional goals for the next 2 years, the next 5 years?"
skip_line 1
puts "Wow."
sleep 0.3
skip_line 1
puts "Just don't put me on Jeopardy, ok?."
listen
sleep 0.3
puts "Thanks."
listen
sleep 0.8
skip_line 1
puts "5. Tell me about the last time you made a mistake. If you encountered the situation again, what would you do differently?"
listen
sleep 0.3
puts "Now, how about that first question again:"
sleep 0.3
print "."
sleep 0.3
print "."
sleep 0.3
print ".\n"
listen
# "I can't wait to try"
end #while loop
# puts "Whatever."
puts
sleep 0.8
puts "Those were all the questions!"
sleep 0.4
puts "Good luck with your application."
listen
skip_line 2
puts "Don't worry about your video..."
skip_line 5
puts "I think we'll be able to come up with something good."
skip_line 3
puts " ;)"
skip_line 7
puts "Good night....."
else
puts "What up, Chloe!!!"
listen
puts "Would you like to play Pico Fermi Bagels?"
response = listen
end