Scratch Christmas
30 mins
+180 XP
What you need:
Chromebook/Laptop/PC or iPad/Tablet

Elf Name Generator

What's your elf name? In this Christmas project we create an "Elf Name Generator" that tells you your elf name based on the first letters of the first and last names.

Lesson Files

Live Class Feed

This is a live feed of the latest activity by your students on this lesson. It will update in real-time as they work on the lesson.
Load previous activity

    1 - Introduction

    In this project an elf will ask you what your first and last names are. Then using the first letter of each of your names, it will look up lists and put together what your elf name is.

    The starter project that you will use has 3 lists already setup:

    1. An alphabet list that has the 26 letters in the alphabet
    2. A first names list that has 26 Christmassy first names
    3. A last names list that has 26 Christmassy last names

    When you tell the elf your first name, he will get the first letter of your name and get index number of it in the alphabet list.

    For example if your name is David, he will get the letter D and then lookup in the alphabet list what the index number for D is, which is 3. Then he can get the number 3 item in the first names list which is 'Mistletoe'.

    index'alphabet' listindex'first names' list
    0A0Reindeer
    1B1Plum pudding
    2C2Holly
    3D3Mistletoe
    4E4Pine
    5F5Candy canes

    And then the elf will do the same thing using the first letter of your last name and the 'last names' list.



    2 - Open the starter project

    We've created a starter project that has the 3 lists already created. Open this starter project by clicking on the following link:

    https://scratch.mit.edu/projects/463152071/editor/

    3 - Add the Winter backdrop

    Add the Winter backdrop from the backdrop library.


    4 - Save and upload the Elf sprite

    Included with this step is a picture of an elf. Save it to your computer and then upload it into your project as a new sprite.


    5 - Create 2 variables

    We need to create 2 variables:

    • an index variable to store what index number of the items in the lists to use.
    • an elf name variable to store what our elf name is.

    Create the 2 variables and then add the following code to the elf sprite to start off the elf name variable as blank.

    whenclickedsetelf nameto

    Unlock the Full Learning Experience

    Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more in our Digital Skills Curriculum.

    Copyright Notice
    This lesson is copyright of Coding Ireland. Unauthorised use, copying or distribution is not allowed.

    Scratch is developed by the Lifelong Kindergarten Group at the MIT Media Lab. It is available for free at https://scratch.mit.edu
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more