Skip to main content

You found a treasure chest. Now what? You need an inventory to carry the loot. Welcome to lists.

The Treasure Hunt pack teaches list operations — creating collections of items, adding to them, checking their contents, and removing what you don’t need. Lists are how programs manage groups of things.

The Challenges

Start Your Inventory — Create a list with your starting items. A sword, a torch, a map. Print the list. You’ve just created your first data structure.

Stock Up — Add new items to your inventory. The “add to list” block appends items to the end. Your collection grows as you explore.

How Much Loot? — Check the length of your inventory. How many items are you carrying? The “list length” block counts them. Useful in games, useful in every program that works with collections.

Find the Key — Search your inventory for a specific item. Is the key in your bag? Use list operations to check. This is search — one of the most fundamental operations in computer science.

Drop the Junk — The advanced challenge. Remove items from your inventory by position. Too many rocks weighing you down? Drop them. List removal is trickier than adding — you need to know the index.

What You’ll Learn

Almost every program you’ll ever write uses lists. Playlists are lists of songs. Shopping carts are lists of items. Social media feeds are lists of posts. Email is a list of messages.

The Treasure Hunt pack teaches you to think in collections. Not just single values, but groups of values that you can add to, search through, measure, and modify.

Five challenges. One inventory. Unlimited loot.