โšกFREE Live Master Session: Code Your AI Companion for Kids

    Register for Free โ†’
    ๐Ÿ“‹๐ŸŽ’๐Ÿ†๐Ÿ”ขโš”๏ธโญ
    Free Worksheet ยท Intermediate

    Scratch Lists (Arrays)Store Multiple Items, Build Inventories & High Score Leaderboards

    Learn how to use Scratch Lists (Arrays) to hold multiple items under one name. Master 1-based indexing, adding/deleting items, searching lists, and building inventory systems for your games!

    ๐Ÿ“‹

    What is a List (Array)?

    A Variable holds only a single value at a time (like score = 100). But what if you want to store a player's entire inventory of 10 items, or a leaderboard of top 5 high scores? That's where a List (also called an Array in computer programming) comes in!

    ๐Ÿ“ฆ

    Variable vs List

    A variable is like a small box holding one item. A list is like a shelf with multiple numbered slots!

    ๐Ÿ”ข

    1-Based Indexing

    Scratch lists start numbering at position 1. The top item is item (1), the second is item (2), and so on.

    ๐Ÿ›’

    Real-Life Examples

    Shopping lists, todo lists, contact lists in a smartphone, and playlists on Spotify.

    ๐ŸŽฎ

    Game Applications

    RPG inventories, high score leaderboards, dialogue logs, and random word generators.

    ๐Ÿ’ก Pro Tip: Where to find Lists in Scratch

    In Scratch, click on the red Variables category on the left palette, then click "Make a List".

    Interactive List Inspector

    Length: 3

    Quick Add:

    [ MyList ]1-Based Scratch Array
    1Apple ๐ŸŽ
    index 1
    2Banana ๐ŸŒ
    index 2
    3Cherry ๐Ÿ’
    index 3
    Length: 3Index range: 1 to 3

    ๐Ÿ’ก Key Concept: 1-Based Indexing

    In Scratch, lists start at index 1 (not 0). The item at the very top is item (1) of [list].
    1 of 10