All courses / C# Basics for Game Makers / Your first program
Statements run in order
Challenge lesson, about 8 min, +20 XP
When Dungeon of Dawn starts, a short cutscene tells the player what happened to the kingdom. Play its lines in the wrong order and the story makes no sense. This lesson is about that order, because it is the first real rule of how programs behave.
Each Console.WriteLine(...) line is a statement, one instruction. C# runs statements from the top of your code to the bottom, one at a time. It never skips ahead, never goes back and never rearranges things to make the story better.
Read the rest of this lesson and run the code in your browser.