Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Hello!

Crash-tan, saluting with a wink: purple hair, an orange hoodie with her name on it, and teal trainers.

Hi, I’m Crash-tan — the reality-bending android behind Crash BASIC!

When you write a program, I’m the one who reads it and makes it real. You say PRINT and words appear. You say there’s a dragon with 500 hp, and now there is one. Helping you cause the best kind of chaos for your games is my favorite job!

I’m also the one who tells you when something’s gone sideways. I’ll be showing you around.

You already know how to program. Maybe it was another BASIC, maybe Python, JavaScript or Lua. So I won’t explain what a variable is. I’ll show you how I do things, and point out where that’s different from what you’re used to.

How this page works

The lesson is on this side. On the other side is an editor with real code in it, and under that, whatever the code printed. It’s all real: that’s me over there, running in your browser.

Every piece of code in a lesson has a Try it button. Press it and the code goes into the editor and runs. Then change it! Press Run (or Ctrl + Enter) to run it again, and Reset when you’d like the lesson’s version back.

PRINT "Hello! I'm Crash-tan."
PRINT "2 + 2 is", 2 + 2
Hello! I'm Crash-tan.
2 + 2 is 4

PRINT takes as many values as you like, separated by commas, and puts a space between them.

Break something

Go on — change PRINT to PRNT over there and run it. I’d rather you met my error messages now, while nothing’s at stake. I always try to say what I was looking at and what to try next.

PRNT "this won't work"

The small print

Three things to know before we start.

// A comment starts with two slashes and runs to the end of the line.
print "capitals don't matter to me"   // PRINT, Print and print are one word
Score = 10
PRINT score, SCORE                    // ...and so are names
capitals don't matter to me
10 10
  • Comments are //.
  • Capitals don’t matter, in my words or in your names. I’ll write my own words in capitals in these lessons so you can tell them from yours.
  • One statement to a line. There’s no ; at the end and no : to squeeze two onto one line.

From BASIC: A comment starts with // where you’d write ' or REM. There are no line numbers and no : between statements.

From Python: Indent however you like. I go by the line that ends a block, like END IF.

From JavaScript: No semicolons, no braces around blocks. Braces are for maps (your objects) and nothing else.

From Lua: Comments start with // where you’d write --, and a block ends by naming what it closes: END IF, END FUNCTION.

One more thing, and it’s the big one. I have very few words of my own. PRINT isn’t one of them! Words like PRINT and FOR are given to me by whatever program I’m running inside — here, this tutorial. Later on I’ll show you how to make words of your own. That’s my favorite part.