There are basic programming options and advanced options.
Easiest way To explain is to post pics. Just so you can get idea. These pics are from the iPhone app.
The 3rd shot is the "code" I mean. It is basic "if" statements. Could be tweaked to do pretty complicated things.
Google the unofficial apex guide. Gives in depth explanations on programming.