Week 13: Data structures
C code typing course. 22 wpm, 94% accuracy.
A data structure keeps related pieces of information together in one place. In C, you define a new structure with the struct keyword. Its fields sit between curly braces, and you reach one field with a period, as in player.wpm. This week you practice typing {, }, : and . on the US English layout.
What you will learn
On the US English layout:
{: the [ key with Shift. Press Shift with the opposite pinky, and press the [ key with your right pinky.}: the ] key with Shift. Press Shift with the opposite pinky, and press the ] key with your right pinky.:: the ; key with Shift. Press Shift with the opposite pinky, and press the ; key with your right pinky..: the . key, with your right ring finger.
A struct that stores a typing result:
struct player {
int wpm;
int accuracy;
};
Technique tips
- Think of the opening brace and the closing brace as one pair. Write the fields two lines in, so the block is easy to read.
- The colon uses Shift and the same key as the semicolon. Check the screen to confirm you typed a colon and not a semicolon.
- Type a period right against the field name, as in
player.wpm, with no spaces around it. - Press Enter and the lines inside the struct are indented for you. Do not add extra spaces by hand.
Lessons
- Lesson 1, learn (10 to 15 minutes): Watch the four symbols on the keyboard demo. Type each one five times.
- Lesson 2, practice (10 to 15 minutes): Type the
struct playerblock from the example. Then typeplayer.wpmandplayer.accuracy. - Lesson 3, review (10 to 15 minutes): Take the two-minute test with struct lines. Save your result and practice the braces you got wrong.
This week’s goal
This week’s target is 22 WPM and 94% accuracy. Finishing the week’s lessons earns you 1 star. Reach 94% accuracy for 2 stars, and also reach 22 WPM for 3 stars. A missing brace in a struct affects the whole block, so focus on accuracy first.
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.