Sunday, March 6, 2011

Building Loud Mouth

So this weekend I've been working through chapter 12 in Beginning Ruby, which is about building a larger program using the techniques learned so far. The program is building a basic chat bot, and so far I've coded functionality for getting information from a user, switching pronouns and returning the original sentence so that it appears the chat bot is asking a question. I also named the chatbot Loud Mouth.

My understanding is this is similar to how a lot of chat bots work, at a very basic level.

But here's something that's been bothering me. I can't run this kind of program straight from TextMate. I have to run it through IRB in order to collect information the program can manipulate. Is there a way to make it so I can just run it from TextMate, or is there a text editor others use that allows you to do that? I'd prefer just to deal with one open program and I like to run it periodically to see how the changes I've made to the code affect functionality. Or if they break it!

Also, when a user inputs information that is collected with the gets command, where is that information stored? Is it stored at all, or just used immediately by the program and then discarded?

1 comment:

  1. Ha, I forget many non-programmers aren't used to using more than a single app at a time. You'll have to get used to this. There are editors that integrate them all, but they suck.

    At minimum I'm running 3-4 tabs in Terminal, a few relevant pages open in Chrome, and TextMate.

    gets simply returns that information, you can store it or discard it, it's up to you.