Concept Explanation
This lesson is a focused syntax workout. Instead of covering many ideas at once, it gives you a small Kotlin example and asks you to read it carefully, adjust values, and pay attention to how the language expresses intent. You will practice Kotlin basics such as immutable values, simple conditions, and string templates while keeping the code easy to follow. The aim is not speed, but comfort with the syntax so that reading Kotlin starts to feel natural.
Where to Put the Code
- Define color and position variables at the top.
- Create shape drawing or placement logic in the middle.
- Render output (print, canvas, SVG, or styled block) at the end.
Command Reference
- Predict the output before running the file, then verify it.
- Change one value and explain why the condition now behaves differently.
- Rewrite one line to make the message more natural for a learner.
- Note one Kotlin syntax feature here that improves readability.
Step-by-step Guide
- Read the starter code and identify every declared value.
- Run the example without edits and confirm your prediction.
- Change either the lesson count or project flag and rerun it.
- Refactor one message so it sounds more human and clear.
- Write a short note about how the condition controls the output.
Practice Exercises
- Add a second branch for a medium-sized course scenario.
- Replace the hard-coded text with your own course example.
- Create a similar snippet using different values but the same structure.
Coding Challenges
- Keep the code simple while making the branching logic slightly more descriptive.
- Compare two versions of the condition and decide which one reads better.
Mini Practice Tasks
- Rename one variable for clearer intent.
- Add one extra output line that uses string interpolation.
- Describe in one sentence what this snippet checks.
Common Mistake
Mixing x and y axes or using wrong coordinate origin causes shapes to appear in unexpected places.
Real-life Mini Challenge
Draw one square, one triangle, and one circle, then move X marker 2 steps right and 1 step down.