Week 8: Conditions

Small Basic code typing course. 17 wpm, 92% accuracy.

A condition lets a program do different things depending on a question. If the score is high enough, show one message. If not, show another. In Small Basic this structure starts with If, continues with Then and ends with EndIf. This week your goal is to write these three keywords correctly and type the comparison symbols inside them without mistakes. A badly written condition either never runs or takes the wrong path.

What you will learn

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

  • :: ; key + Shift (Shift with the left pinky). Right pinky on the semicolon key.
  • <: , key + Shift (Shift with the left pinky). Right middle finger on the comma key.
  • >: . key + Shift (Shift with the left pinky). Right ring finger on the period key.
  • =: = key, right pinky.

Example:

If score >= 50 Then
EndIf

The lines between If and EndIf run only when the condition is true. The >= sign means greater than or equal to. You will also type the colon in this week’s drills.

Technique tips

  • Press Shift with your left pinky for < and >. Keep the right hand steady and let only the needed finger move.
  • The colon needs Shift with the left pinky. The equals sign needs no Shift, so press it straight with the right pinky.
  • Write an If block in order: the If and Then line first, then the body, and the EndIf line last. You will never forget to close the block this way.
  • Enter fills in the indentation of the next line, so the lines inside the block are indented for you. Just type the code.
  • After you type the two similar symbols, < and >, press each one once slowly to feel the difference.

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: Build one If block. Write the condition, then the body, then EndIf.
  3. Lesson 3, 10 to 15 minutes: Review what you practiced, then take the 2-minute test.

This week’s goal

The targets are 17 wpm and 92% accuracy. Finishing the lessons earns one star. Reaching 92% accuracy earns the second star. The third star also needs 17 wpm. Check that every If has a matching EndIf. Missing one is one of the most common mistakes.

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

    13 minutes

    Start
  3. Lesson 3: Review and test

    Review and test

    13 minutes

    Start

All weeks