🎯 පාඩමේ අරමුණු
මේ පාඩම ඉවර වෙද්දී ඔයාට:
- AI ලියපු ඔයාගේ පළවෙනි code piece එක generate කරන්න පුළුවන් වෙයි
- Fully understand නොකර code READ කරන්න ඉගෙන ගන්න පුළුවන් වෙයි
- Basic code elements (variables, functions, print statements) identify කරන්න පුළුවන් වෙයි
- AI ට code explain කරන්න ask කිරීම practice කරන්න පුළුවන් වෙයි
📖 Introduction: Running කරන්න කලින් Reading
Vibe coding වලට important principle එකක් මෙන්න:
Reading Principle එක
Code එක්ක effectively WORK කරන්න කලින් Code READ කරන්න ඕන.
Syntax මතක තියාගන්න හෝ scratch එකෙන් code ලියන්න ඕන නැහැ. නමුත් ඔයා MUST:
- Different parts මොකද කරන්නේ recognize කරන්න
- Potential problems spot කරන්න
- Logic flow තේරුම් ගන්න
ඒක music producer කෙනෙක් වෙනවා වගේ — every instrument play කරන්න ඕන නැහැ, but something sounds wrong නම් hear කරන්න ඕන.
🎮 Workshop Task එක
Simple program එකක් create කරමු:
Goal: Birth year අහලා age කියන Python script එකක්.
ඇයි Python?
- Clean, readable syntax
- Code READ කරන්න ඉගෙන ගන්න perfect
- Most common languages වලින් එකක්
ඇයි මේ Task?
- Understand කරන්න enough simple
- Real coding concepts පෙන්වන්න enough complex
- Clear input → process → output තියෙනවා
📝 Step 1: ඔයාගේම Prompt එක මුලින් ලියන්න
Examples බලන්න කලින්, මේ task එකට ඔයාගේම prompt ලියන්න try කරන්න.
Task එක: AI ට Python script එකක් create කරන්න කියන්න:
- User ගේ birth year අහනවා
- Age calculate කරනවා
- Age එක්ක friendly message පෙන්වනවා
Reflection Journal
ඉදිරියට යන්න කලින් මේක ලියන්න minute එකක් ගන්න!
📝 Step 2: Example Prompt එක්ක Compare කරන්න
C.I.C. + Role use කරලා well-crafted prompt එකක් මෙන්න:
ඔයාගේ prompt එක්ක compare කරන්න:
- Python specify කළාද?
- Friendly message ask කළාද?
- Comments/explanations request කළාද?
🤖 Step 3: Generated Code එක
Prompt එක send කළාම මේ වගේ එකක් ලැබෙන්න ඕන:
# Age Calculator Program # Get the current yearcurrent_year = 2024 # Ask the user for their birth yearbirth_year_text = input("What year were you born? ") # Convert the text input to a numberbirth_year = int(birth_year_text) # Calculate the ageage = current_year - birth_year # Display a friendly messageprint(f"Awesome! You are {age} years old this year! 🎂")Note: ඔයාගේ AI output එක slightly different විය හැකි — ඒක okay!
🔍 Step 4: Code Reading Scavenger Hunt
දැන් මේ code READ කරන්න ඉගෙන ගමු. Generated code එක බලලා මේ questions වලට answer කරන්න:
Question 1: Variables හොයන්න 🔎
Variables යනු information store කරන labeled boxes. = sign use කරලා create කරනවා.
Variables කීයක් spot කරන්න පුළුවන්ද?
Question 2: Math එක හොයන්න ➕➖
Age determine කරන calculation එක හොයන්න.
Subtraction වලට use කරන symbol එක මොකක්ද?
Question 3: Output එක හොයන්න 📤
print() function user ට text display කරනවා.
User දකින message එක මොකක්ද?
Question 4: Input එක හොයන්න 📥
input() function user ට type කරන්න ask කරනවා.
Program එක ask කරන question එක මොකක්ද?
Question 5: Conversion එක හොයන්න 🔄
Birth year වලට variables දෙකක් තියෙන එක notice කරන්න. ඇයි?
📊 Code Reading Quick Reference
Code කියවනකොට බලන්න ඕන දේවල් මෙන්න:
| Pattern | Usually Mean කරන්නේ |
|---|---|
something = value | Data create/store කිරීම (variable) |
function() | Action එකක් කිරීම |
# text | Comment එකක් (computer ignore කරනවා, humans ට help කරනවා) |
"text" හෝ 'text' | Text piece එකක් (string) |
+, -, *, / | Math operations |
print() | User ට මොකක් හරි display කිරීම |
input() | User ට type කරන්න ask කිරීම |
if, else | Decisions ගැනීම |
for, while | මොකක් හරි repeat කිරීම |
🎓 Step 5: AI ට Explain කරන්න Ask කරන්න
දැන් AI ගෙන් explanations ගන්න practice කරන්න. මේ follow-up prompts try කරන්න:
Line-by-Line Explanation වලට:
Specific Part වලට:
Concepts වලට:
🧪 Step 6: Prompts හරහා Modify කරන්න
දැන් AI එක්ක conversation හරහා code modify කිරීම practice කරන්න.
Modification 1: Message එක Change කරන්න
Modification 2: Info වැඩි කරන්න
Modification 3: Validation Add කරන්න
මේවා එකින් එක try කරන්න. ඔයාගේ requests අනුව AI code modify කරන හැටි බලන්න!
🔑 Key Code Vocabulary
මේ lesson එකට පස්සේ, ඔයා recognize කරන්න ඕන:
| Term | ඒක මොකක්ද | Example |
|---|---|---|
| Variable | Data වලට named storage | age = 25 |
| String | Text data | "Hello World" |
| Integer | Whole number | 2024 |
| Function | මොකක් හරි කරන action | print(), input() |
| Comment | Humans වලට note | # This is a comment |
| Assignment | Variable එකේ value store කිරීම | x = 5 |
✅ Completion Checklist
✅ ඉදිරියට යන්න කලින් verify කරන්න:
0/6✅ පාඩමේ සාරාංශය
ඔයා Accomplish කළ දේ
- ✅ Code generation වලට ඔයාගේ පළවෙනි prompt ලිව්වා
- ✅ Working Python script එකක් AI ලවා create කරවගත්තා
- ✅ Parts තේරුම් ගන්න code analyze කළා
- ✅ AI ගෙන් explanations ask කිරීම practice කළා
- ✅ Follow-up prompts හරහා code modify කළා
Key Insight
Syntax මතක තියාගන්න ඕන නැහැ. Patterns recognize කර AI එක්ක clearly communicate කරන්න ඕන.
📝 Mini Quiz
📝 ඔයාගේ Understanding Check කරන්න
1/3What does a variable do in programming?