# Visual to text coding:Index page

Years 5-6; 7-8

This lesson sequence provides a bridge between visual coding (eg. Scratch) and General Purpose Programming languages (eg. Python or JavaScript).

Each video builds a simple program in all three ways: Scratch, Python and JavaScript.

This resource is most suitable if:

• you have never done General Purpose Programming,
• you benefit from slow-paced, step-by-step video tutorials.

### Setting Up

Use these two videos to:

• set up your programming environment.
• go through some of the common errors that people fall victim to!
1. Setting Up
1a. Gotchas

### The Basics

Use these three videos to:

• learn how to store, concatenate and output data.
• build a simple application to consolidate knowledge of these skills

### Lesson 1: Temperature converter

#### Two/three 45-minute periods

• Use pseudocode for code design.
• Introduce variables.
• Design and code a program to convert temperature units (°C to °F).
• OPTIONAL: Challenge yourself to build other converters, including currency.

#### Videos in this lesson:

Celsius converter:

Improving output:
Currency converter:

Bitcoin tracker:
How much Netflix?

### Lesson 2: Calculator

#### Two/three 45-minute periods

• Introduce branching (decisions).
• Identify data types.
• Design and code a text-based calculator.
• OPTIONAL: Challenge yourself with an ice cream vending interface and a Maths quiz.

#### Videos in this lesson:

Making decisions:

Calculator

International Space Station position

### Lesson 3: Heads or Tails

#### Two/three 45-minute periods

• Introduce random numbers.
• Design and code a heads-or-tails game.
• OPTIONAL: Challenge yourself with a dice roll simulator.

#### Videos in this lesson:

Dice roll simulator:

### Lesson 4: Paper, scissors, rock

#### Two/three 45-minute periods

• Introduce combining of logical operators and
and or.
• Design and code a game with complex win conditions.
• OPTIONAL: Have a go at designing your own Rock-Paper-Scissors-Lizard-Spock program.

#### Videos in this lesson:

Scissors, Paper, Rock game (overview)
Scissors, Paper, Rock game (coding)

#### Two/three 45-minute periods

• Set up pseudocode for code design
• Introduce Arrays and Lists
• Design and code a random Password Generator
• OPTIONAL: Create a random fantasy character, game show challenge and shopping list

### Lesson 6: Magic 8 ball

#### Two/three 45-minute periods

• Introduce the length property for arrays.
• Design and code a Magic 8 Ball to advise you.

#### Videos in this lesson:

Length property

Decision maker and magic 8 ball

### Lesson 7: Times tables

#### Two/three 45-minute periods

• Introduce iteration (loops).
• Design and code a times table generator for any number.

Loops
Times tables

### Lesson 8: Guess the number

#### Two/three 45-minute periods

• Design and code a higher/lower game, where the player must guess a secret number between 1 and 20.

Guess the number
Vowel replacer

### Lesson 9: Loops and arrays combined

#### Two/three 45-minute periods

• Discover how loops and arrays work together for powerful programs.
• Build a program to analyse student marks and make useful information.
• OPTIONAL: Challenge yourself to process new data.

#### Videos in this lesson:

A program to analyse marks

### Lesson 10: Simple functions

#### Two/three 45-minute periods

• Set up and practice using turtle graphics in Scratch, Python and JavaScript.
• Create functions without parameters.
• Incorporate loops (iteration) inside a function.
• Discover how functions help organise code.
• OPTIONAL: Challenge yourself to draw a cosmic image

Note: Turtle graphics is an effective context to learn about functions, but examples will also be provided for writing functions outside of the turtle graphics context.

#### Videos in this lesson:

Simple functions in Scratch

Simple functions in Python & JavaScript

### Lesson 11: Adaptable functions with parameters

#### Two/three 45-minute periods

• Create functions that adapt their behaviour thanks to parameters.
• Observe how functions reduce repetition in code.
• OPTIONAL: Challenge yourself to generate a size chart.

#### Videos in this lesson:

Reducing repetitive code

### Lesson 12: Functions that give back (return values)

#### Two/three 45-minute periods

• Identify and describe some of the in-built functions you have been already been using.
• Create functions with return values. They give back an answer, rather than just perform an action.
• Observe how functions are used in Graphical User Interfaces, triggered by user inputs.
• OPTIONAL: Challenge yourself to write a small battle game by building a library of functions.

#### Videos in this lesson:

Functions with return values

### Next steps

View our next lesson sequence that provides step-by-step video tutorials and challenges to incorporate Graphical User Interfaces (GUIs) into your General Purpose Programming.

Here are some other recommended options to continue with General Purpose Programming:

• Coding a sentimental chatbot in Python

A series of video tutorials to build a chatbot in Python that incorporates AI (Natural Language Processing). Coding difficulty is appropriate for students who have worked through the Visual to Text Coding lesson sequence.

• Python and JavaScript DT Challenges from the Australian Computing Academy

Hosted on the Grok Learning platform, these self-paced coding courses are free for Australian students in Years 3-8.

• App Lab at code.org

Use JavaScript* via blocks or text to create apps. The App Lab is also incorporated into free courses at code.org.

• The MakeCode platform is a set of online environments supporting both block coding and general purpose programming.

MakeCode for micro:bit is an online environment for writing code for the popular micro:bit device. It supports both JavaScript* and Python. A simulator allows testing of code without the physical device, though the device is recommended. Lessons and project ideas are available on the official site. Physical Tech from Go to WHOA! is also suggested.

MakeCode Arcade is an online environment for writing code for MakeCode Arcade devices, which function like small handheld game consoles. It supports JavaScript*. A simulator allows testing of code without the physical device. Lessons and project ideas are available on the official site.

MakeCode for Minecraft is an online environment for writing code to run in Minecraft. It supports both JavaScript* and Python.

* This is actually Microsoft's variant TypeScript.

It is linguistically very similar to JavaScript.