Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    Introduction to Lists

    2D Blocks
    1
    1
    459
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • info-creaticode
      CreatiCode last edited by admin

      Prerequisite

      • Introduction to Variables

      What is a List?

      You already know how to use a variable as a box to store some number or text. When you work with a sequence of values, such as the ages of all your classmates, then you should use a “list” instead.

      A list is an array of boxes, where each box has a different position number (indices).

      Since all the boxes look the same, we need to use the position index number to refer to a box. For example, you can say “The box at position 2 contains the number 8”.

       

      Making a New List

      To create a new list, go to the “Variables” category, and click the “Make a list” button.

       

      Renaming or Deleting a List

      These steps are very similar to how you rename or delete a variable.

       

      Showing or Hiding a List

       

       

      Adding Empty Items to a List

      By default, a new list has no items (slots) in it. You can click the “+” button on its bottom left corner to add empty items. The “length” value will tell us how many items are in the list, which is how many values this list can carry.

       

       

      Removing an Item

      When any item is selected, there is a small “x” on its right, which can be used to remove this item.

       

      Adding Data

      You can input numbers or text in any item of the list. If you press the ENTER key, a new empty item will be added below the current one, which makes it easier to enter many values.

      Note that when you save the project, the content of the list is saved as well. So the next time you open this project, the list will contain the same content.

       

      Learn More

      • Editing a List Using Blocks
      1 Reply Last reply Reply Quote 0
      • Pinned by  info-creaticode info-creaticode 
      • First post
        Last post