John is thirsty and wants to drink milk from the fridge.
Your mission is to write a Python script using the provided functions to complete this task.
The level has multiple possible paths to solve it. Your solution will be scored based on:
'Delicious!'
),Some functions are optional, like check_freshness()
or look_inside_fridge()
, but using them adds quality and increases your score.
Also note: A single level can include multiple challenges, and each challenge can be solved in multiple ways.
All functions are predefined and behave as described.
Function | Description | Optional | Score Impact |
---|---|---|---|
open_fridge() |
Opens the fridge so John can interact with its contents | โ | Required (0) |
look_inside_fridge() |
Lets John inspect the contents before grabbing anything | โ | +10 |
grab_item(item_name) |
Picks an item (e.g.,"milk" ) from the fridge |
โ | Required (0) |
check_freshness(item_name) |
Checks if the milk is fresh | โ | +20 |
wash_glass() |
Cleans the glass before use | โ | +10 |
pour_into_glass(item_name) |
Pours the milk into a clean glass | โ | Required (0) |
drink_from_glass() |
Makes John drink and return'Delicious!' |
โ | +100 (goal) |
inventory() |
Lists what John currently has (glass, milk, etc.) | โ | +5 |
Create a valid script that ends with:
<aside> โน๏ธ DELICIOUS!
</aside>
Then, explore multiple possible paths and assign a score to each based on their safety and efficiency.