Javascript - Challenge
Code Life
By Pierre Marsaa
Inventory Manager
Manage your bag during the adventure:
1.
You pick up "Rope" then "Torch": they go at the end of the bag
2.
You find a "Key": it must go at the very front of the bag
3.
You use the last item: remove it and print "Used: X"
4.
Print "Items: N" with the number of items left
5.
If the bag contains the key, print "You can open the door!", otherwise "The door stays closed"
↗️
Loading editor...
↶
↷
💡 Show Solution
Continue