Chat bot in Ruby 2.5.0
A chat bot I made in Ruby 2.5.0
amasad (3343)
Nice! Maybe have it loop so it doesn't exit? Ask a simple question like "what's on your mind?" to keep the user entertained 😂
Bloxy_Cola (16)
@amasad added!
dotcomboom (139)
@Bloxy_Cola
You can put it in a loop like this:
loop do
puts 'Bot: Whats on your mind?'
puts 'Bot: wow,' + gets.strip + 'looks like fun!'
end
Bloxy_Cola (16)
@dotcomboom Ok! Thats good! Thanks!
PS: how do you do that code text thing?
dotcomboom (139)
@Bloxy_Cola ah, you surround it with three backticks (`)
Bloxy_Cola (16)
@dotcomboom so like this <p>Hi</p
Might I suggest adding spaces between the ends and beginning of the user's input perhaps? It kinda squishes it all together.
@k4t3xpl0si0n I dont understand...
@Bloxy_Cola Whenever a user types something in, the bot replies with (for example: ) "wow,pizzalooks like fun!"
@k4t3xpl0si0n 0h, thanks!