All courses / C# Basics for Game Makers / Your first program

Fixing compiler errors

Challenge lesson, about 9 min, +20 XP

Everyone makes typos, even people who have coded for twenty years. The difference is that they read the error message instead of staring at the screen and hoping. Tonight Grix and the goblins attack the tower, and the wizard's fireball scroll is full of typos. This lesson turns you into someone who reads the message.

Before your program runs, a tool called the compiler reads all of your code, top to bottom, and checks it against the rules of C#. It is a very strict proofreader. If everything is fine, the program runs. If it finds a problem, the program does not run at all, and you get a red error box instead.

Read the rest of this lesson and run the code in your browser.

Previous: Printing a text box   Next: Comments

© 2026 Xero Media LLC. All rights reserved.