11.1b — Create PT: Build Day 1
Build day one, PT rules: write the LIST-CENTERED core. The list is the requirement graders poke hardest — today it goes in first, works alone, and prints so you can SEE the data move (input, behavior, output, remember).
The day's contract:
- The program RUNS — even if it only prints
- The list EXISTS and participates: add, remove, access, or traverse — not a decoration
- A Debug.Log(...) rendering of the list's state after each change, so "behavior" is visible NOW (graders see a VIDEO later; you see the console today)
Starter-voice template for a list-centered core (adapt to your program — names matter for your WR answers):
private List<string> inventory = new List<string>();
public void AddItem(string itemName) // procedure + parameter!
{
if (!inventory.Contains(itemName)) // selection
{
inventory.Add(itemName);
Debug.Log("added " + itemName + " → " + ListContents());
}
}
private string ListContents()
{
string s = "";
foreach (string item in inventory) // iteration
{
s += item + " | ";
}
return s; // output of a procedure
}
That one method pair already has: procedure, parameter, selection, iteration, list participation, observable output. Your 10.2c muscle, aimed at a rubric.
The WR2a pre-answer (5 min, write it NOW while coding): "The list ___ stores ___; the program appends when ___, removes when ___, and traverses to ___." Write the sentence the same day you write the code — future-you will not remember why the list exists; today-you does.
Socratic: The List Goes In First
- The list went in before anything that uses it. What did printing the list tell you that reading the code would not have?
- Your list is the requirement graders poke hardest. Which of your list operations could a grader point at as proof, and does your code show it clearly?
- Today the program only had to work alone, with no user. What did you postpone, and how do you know the list will still hold when the input arrives?
Checkpoint — before moving on, you must be able to:
- Run the program with the list visibly participating
- Point at a procedure with a parameter and its CALL site
- Show selection and iteration inside one algorithm
- Read your WR2a sentence out loud and nod
Reference Docs
Need a deeper explanation? These pages cover the same concepts:
- Lists & Arrays — your core, documented
- Create PT guide — the rubric rows you are feeding
Saved on this device only — the Dashboard tracks your progress.