0% found this document useful (0 votes)
2 views

Printing First Element Array

The document provides a step-by-step guide for creating an activity in the MakeCode Arcade editor that prints the first element of an array. It explains how to set up a new project, create an array, and use various blocks to display a message on the screen. The instructions include naming the project, adding elements to the array, and using the 'Splash' block to show the message with the first element of the array.

Uploaded by

Deepa Gayathri
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Printing First Element Array

The document provides a step-by-step guide for creating an activity in the MakeCode Arcade editor that prints the first element of an array. It explains how to set up a new project, create an array, and use various blocks to display a message on the screen. The instructions include naming the project, adding elements to the array, and using the 'Splash' block to show the message with the first element of the array.

Uploaded by

Deepa Gayathri
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Activity – Printing the first element of the array

An array is a list of items that are text, numbers, booleans, or strings. Arrays
have a length which is the number of items they contain. Items in an array can
be identified by knowing their positions.

Arrays are flexible, they can grow and shrink in size. We can add, remove as
well as edit items at any place in the array.

In Blocks, Arrayscan be found under the Advanced section.

Create the activity on Arcade using the MakeCode editor in the URL
https://arcade.makecode.com

Step 1: Create a
New Project by
clicking on ‘New
Project’. A
dialog box
‘Create your
project name’
appears.

Step 2: Name the


project as “arr”
and click on
‘Create’ Button.
Once the project
is created, the
editor screen is
visible.

Step 3: Click on
the “Arrays”
block type from
“Advanced” and
drag the “set
textlist to array”
block to
Workspace.

Click on “Text
list” drop down
and choose ‘New
variable’ and
name as ‘arr’.
Once created,
click on “text list’
drop down again
and choose ‘arr’
from the list.
Step 4: Click on
“+” in “set arr”
block and add “d”
“e”.

Place “set arr”


block within “on
start” block.
Step 5: Select
“Game” from the
list. Drag
“Splash” block
onto the
workspace.

Note: “Splash”
block allows for a
message to pop
up on screen for
the user to read
on the simulator
window.

Step 5: Click on
“Advanced” and
“Text” from the
list. Drag “Join
‘Hello’ ‘World’
” block to the
workspace.
Step 6: In “Join
Hello World”
block replace
“Hello” with
“The first element
of the array is”
and “World” with
“ list get value at
0” from “Array”
block as shown.

Step 6: Place the


“Join” block
within “splash”
block.

Select “arr” from


the drop down list
as shown.

Step 5: Click on
the “Functions”
block type from
“Advanced” and
drag “call Wish
‘abc’” block to
“on start” in the
workspace.
On start, the
program calls the
Function “Wish”
with a parameter
and splashes the
message.
Output:

You might also like