Week 6: Brackets and braces

Small Basic code typing course. 15 wpm, 91% accuracy.

To keep several values in one place, you use an array. In Small Basic, you give an array item a value by writing its number or text key inside square brackets, and you read the value back with the same brackets. Curly braces, { and }, are not used in Small Basic code, so this week you type them as a drill only. This week you learn four symbols, [, ], { and }, and practice typing them on the right keys.

What you will learn

This week has four symbols. On the US English layout:

  • [: [ key, right pinky.
  • ]: ] key, right pinky.
  • {: [ key + Shift, opposite pinky. Right pinky.
  • }: ] key + Shift, opposite pinky. Right pinky.

Example:

numbers[1] = 10
numbers[2] = 20
TextWindow.WriteLine(numbers[2])

The first two lines assign values to items 1 and 2 of the array. The third line prints the second item, which is 20.

Technique tips

  • The [ and ] keys sit where the right pinky rests, so you can reach them without moving your hand. Keep the hand steady.
  • In Small Basic, only square brackets reach an array item. Curly braces are typed here as a drill and do not appear in the code.
  • Open, fill in and close each pair in order. Do not jump ahead to the closing symbol before you have typed what goes inside.
  • Press Shift with the opposite pinky for { and }. Avoid lifting your whole hand.
  • Enter fills in the indentation of the next line. Write each array assignment on its own line so every item is easy to follow.

Lessons

  1. Lesson 1, 10 to 15 minutes: Learn the four symbols. Watch the keyboard demo and type each symbol three times.
  2. Lesson 2, 10 to 15 minutes: Assign two items to an array and print one of them.
  3. Lesson 3, 10 to 15 minutes: Review what you practiced, then take the 2-minute test.

This week’s goal

The targets are 15 wpm and 91% accuracy. Finishing the lessons earns one star. Reaching 91% accuracy earns the second star. The third star also needs 15 wpm. Get your pairs right first, then build speed.

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