Write your first lines of code right here — nothing to install, nothing to sign up for.
Each lesson has a box with a little program in it. Press Run to see what it does, then try changing it. You can't break anything: Start over puts the original back. (Tip: Ctrl + Enter also runs the program.)
These lessons use JavaScript, the language every web browser understands.
The command say shows whatever you put inside the brackets. Words go inside
quotation marks. Press Run, then change the message to your own name.
Computers are great at arithmetic. Use + to add, - to subtract,
* to multiply and / to divide. Numbers don't need quotation marks.
A variable is a name for a value, like a labeled jar. let
creates one. Change "Ruth" to your name and the age to yours, then run it.
if lets a program choose what to do. Try changing the temperature to 50 and
running it again.
A loop repeats instructions. This one counts from 1 to 5. Can you make it count to 10? Or count by twos?
This program prints a times table using a variable and a loop. Change 7 to
any number you like.
You've just used variables, decisions and loops — the same building blocks behind every app you use. To keep going, see Getting Started With Programming for free places to learn, or read A Little Computer Science to learn how these ideas fit together.