You definitely could somehow, but it might be some work. You would have to write lots of code to pull apart what the user enters, check to see if they entered something correctly, and then somehow evaluate it. I've been programming for a long time and I don't know how to do that off the top of my head, I bet it would be pretty tough to do.
If you need more help I recommend going here -
http://www.idevgames.com/forum/ , its an active mac programming forum.