Contents
FOREWORD by Carol Vorderman
HOW THIS BOOK WORKS
1 WHAT IS CODING?
What is a computer program?
Thinking like a computer
Becoming a coder
2 STARTING FROM SCRATCH
What is Scratch?
Installing Scratch
Scratch interface
Sprites
Coloured blocks and code
Project 1: Escape the dragon!
Making things moves
Costumes
Hide and seek
Events
Simple loops
Pens and turtles
Variables
Maths
Strings and lists
Co-ordinates
Make some noise
Project 2: Roll the dice
True or false?
Decisions and branches
Sensing and detecting
Complex loops
Sending messages
Creating blocks
Project 3: Monkey mayhem
Time to experiment
3 PLAYING WITH PYTHON
What is Python?
Installing Python
Introducing IDLE
Errors
Project 4: Ghost game
Ghost game decoded
Program flow
Simple commands
Harder commands
Which window?
Variables in Python
Types of data
Maths in Python
Strings in Python
Input and output
Making decisions
Branching
Loops in Python
While loops
Escaping loops
Lists
Functions
Project 5: Silly sentences
Tuples and dictionaries
Lists in variables
Variables and functions
Project 6: Drawing machine
Bugs and debugging
Algorithms
Libraries
Making windows
Colour and co-ordinates
Making shapes
Changing things
Reacting to events
Project 7: Bubble blaster
What next?
4 INSIDE COMPUTERS
Inside a computer
Binary and bases
Symbols and codes
Logic gates
Processors and memory
Essential programs
Storing data in files
The internet
5 PROGRAMMING IN THE REAL WORLD
Computer languages
Coding stars
Busy programs
Computer games
Making apps
Programming for the internet
Using JavaScript
Bad programs
Mini computers
Becoming a master programmer
Glossary
Index
Acknowledgments
This book introduces all the essential concepts needed to understand computer coding. Fun projects throughout put these ideas into practice. Everything is broken down into small chunks so that it’s easy to follow and understand.