All courses / C# Basics for Game Makers / Your first program
Write vs WriteLine
Challenge lesson, about 10 min, +20 XP
When Nico fights Grix on the road to the tower, the combat log writes lines like "Hero hits Goblin for 12 damage." Behind the scenes, the game builds that sentence in pieces: who attacked, who got hit, how much it hurt. Chapter 2 will let you fill those pieces with real numbers. First you need the skill of printing a line in several steps, and that is what this lesson is for.
You have been using Console.WriteLine. The word Line in its name is the clue. It prints your text and then moves down to the start of the next line, like pressing Enter.
Read the rest of this lesson and run the code in your browser.