Week 3: Quotes and strings
Small Basic code typing course. 13 wpm, 90% accuracy.
In Small Basic, a piece of text, called a string, goes between quotation marks. "Ada" is a string. Without quotes, Ada is read as a name and causes an error. That is why opening and closing quotes correctly is essential for a program to run. This week you also learn that a single quote starts a comment in Small Basic. A comment is a note for people reading the code, and the program ignores it.
What you will learn
This week has two symbols. On the US English layout:
": ’ key + Shift, opposite pinky. Right pinky.': ’ key, right pinky.
Example:
name = "Ada"
' this line is a comment
The first line stores a string in the name variable. The second line starts with ', so the program skips it.
Technique tips
- When you open a quote, think about closing it right away. Typing
""first and then filling in the middle prevents missing closing quotes. - Both symbols are typed with the right pinky on this layout, so keep that finger ready.
- Press Shift with the opposite pinky and keep your eyes on the screen while you type the letter after it.
- Comments are part of the code you write. Check them as carefully as the rest.
- Enter fills in the indentation of the next line. Count the spaces inside your strings yourself.
Lessons
- Lesson 1, 10 to 15 minutes: Learn the
"and'symbols. Watch the keyboard demo and type each symbol five times. - Lesson 2, 10 to 15 minutes: Store a string in a variable and add a comment line.
- Lesson 3, 10 to 15 minutes: Review what you practiced, then take the 2-minute test.
This week’s goal
The targets are 13 wpm and 90% accuracy. Finishing the lessons earns one star. Reaching 90% accuracy earns the second star. The third star also needs 13 wpm. Get your quotes right first, speed comes later.
Symbols this week
The colored keys are the ones you learn this week. The color shows which finger presses the key.
This week’s lessons
Do the lessons in order. Each one ends with a test, and your best result is saved.