Overview: Basic practice of variable state tracking using debug mode. Through a weather-based outfit recommendation system, visualize the process of variable setting, referencing, and updating in detail to master debugging techniques in natural language macro programming.
Delete variables.json if it exists Clear all TODO list items
Display "=== Variable Debugging System Started ===".
Load debugger.md first, then execute the following in debug mode:
From the information "Today is sunny with a temperature of 25 degrees":
- Save the weather to {{weather}}
- Save the temperature to {{temperature}}
Display the current values of {{weather}} and {{temperature}}
Execute the following conditional branching in debug mode:
Save the following to {{outfit}} based on the value of {{temperature}}:
-
If {{temperature}} is 30 degrees or higher: → "Short sleeves, shorts, hat, sunscreen"
-
If {{temperature}} is 20 degrees or higher but less than 30 degrees: → "Light long sleeves, light pants, sneakers"
-
If {{temperature}} is 15 degrees or higher but less than 20 degrees: → "Long sleeves, jeans, light jacket"
-
If {{temperature}} is less than 15 degrees: → "Heavy coat, knit sweater, scarf, gloves"
If {{weather}} contains "rain":
- Add "umbrella, raincoat" to {{outfit}}
Execute the following in debug mode:
Combine {{weather}}, {{temperature}}, and {{outfit}} to create complete outdoor preparation advice and save to {{final_advice}}
Display {{final_advice}} as "=== Outfit Recommendation Result ==="