Session 4
- Start SciTE: Start -> All Programs -> Ruby-186 -> SciTE
- Save As … calc.rb on the Desktop
- Start with Numbers
- You can "comment out" lines of code with the hash character '#'
- You can comment blocks of code by selecting and Ctrl-Q
- Ctrl-Q uncomments blocks of code, too.
- Integers and Floats
- Integer division is different!
- On to Letters
- Strings are "strings" of letters in single-quotes
- You can add strings. This is called concatenation.
- You can multiply strings, too.
- But watch out for Type Errors.
- What if you want to put a single-quote in your string?
- Backslash escapes characters.
page revision: 0, last edited: 31 Jan 2009 21:28