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

  1. Lesson 1, learn (10 to 15 minutes): Watch the four symbols on the keyboard demo. Type each one five times.
  2. Lesson 2, practice (10 to 15 minutes): Type the struct player block from the example. Then type player.wpm and player.accuracy.
  3. 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.

` ~ 1 ! 2 @ 3 # 4 $ 5 % 6 ^ 7 & 8 * 9 ( 0 ) - _ = + Backspace Tab Q W E R T Y U I O P [ { ] } \ | Caps A S D F G H J K L ; : ' " Enter Shift Z X C V B N M , < . > / ? Shift Ctrl Win Alt Alt Gr Win Menu Ctrl

This week’s lessons

Do the lessons in order. Each one ends with a test, and your best result is saved.

  1. Lesson 1: Learn

    New symbols: { } : .

    12 minutes

    Start
  2. Lesson 2: Practice

    Practice

    12 minutes

    Start
  3. Lesson 3: Review and test

    Review and test

    12 minutes

    Start

All weeks