Comments are sections of text that are completely ignored by the compiler. They are used to document your source code, add reminders to yourself and others, explain tricky sections of code, or to hide code blocks during testing and debugging.

Line Comments

Line comments span from the double-slash symbol to the end of the line. They are handy for adding descriptions of variables or titles above sections of code.


var entryCount = 0;  // Number of times a player has entered

// wait until Bob is near the bottom of the screen
BOB:
while positionY < 400 {
     delay;
}

Block Comments

Block comments are usually used to comment-out sections of source code during testing and debugging. Nested block comments are not allowed, but they can eclipse line comments, as in this example:


/*
// wait until Bob is near the bottom of the screen
BOB:
while positionY < 400 {
     delay;
}
*/