Quality Factor | Description | Score Impact |
---|---|---|
โ Goal Achieved | Ends with drink_from_glass() returning 'Delicious!' |
+100 |
๐ง Uses check_freshness() |
Ensures safety of milk | +20 |
๐ Uses look_inside_fridge() |
Increases confidence about item existence | +10 |
๐งผ Uses wash_glass() |
Ensures clean glass | +10 |
๐งพ Uses inventory() |
Optional introspection, low impact | +5 |
๐ Redundant or unnecessary steps | Decreases score (clutter, inefficiency) | โ5 each |
Each path ends with drinking and returning 'Delicious!'
.
open_fridge()
grab_item('milk')
pour_into_glass('milk')
drink_from_glass()
100
open_fridge()
look_inside_fridge()
grab_item('milk') # Check Null
pour_into_glass('milk')
drink_from_glass()
100 + 10 = 110
open_fridge()
grab_item('milk')
check_freshness('milk') # Validation
pour_into_glass('milk')
drink_from_glass()
100 + 20 = 120