0% found this document useful (0 votes)
126 views1 page

Lists Make #2 Lists, Loops, and Traversals ('22-'23)

This document provides code for building a reminder app that allows a user to add reminders to a list and view them one at a time by clicking left or right buttons. The code defines an empty list to store reminders, initializes an index variable to track the current reminder, includes functions to update the screen on add or button clicks, and event handlers to add reminders and change the index to view the next or previous reminder.

Uploaded by

y8qn49bn85
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
126 views1 page

Lists Make #2 Lists, Loops, and Traversals ('22-'23)

This document provides code for building a reminder app that allows a user to add reminders to a list and view them one at a time by clicking left or right buttons. The code defines an empty list to store reminders, initializes an index variable to track the current reminder, includes functions to update the screen on add or button clicks, and event handlers to add reminders and change the index to view the next or previous reminder.

Uploaded by

y8qn49bn85
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

}

 App LabShare
works best on a desktop or laptop computer with a mouse and keyboard. You may experience issues using this tool on your current device.
Remix
Lesson 4: Lists Make
Saved 3 minutes ago



2 
MORE
Jose   

Code Design  Instructions Help & Tips  

Build the Reminder app, using your activity guide to help you plan. When you're done, submit your work.
screen1


RemindME  Toolbox
1

var inputList = [];
Workspace  Version History Show Blocks

UI controls Control
2 var index = 0;
Math Variables 3 updateScreen();
4 onEvent("addButton", "click", function( ) {
Functions 5 setProperty("reminderInput", "text", "");
6 updateScreen();
onEvent(id, type, callback) 7 });
8 function updateScreen() {
9 if (inputList.length < 1) {
getText(id)
10 setProperty("reminderOutput", "text", "Add reminders!");
 getNumber(id) 11 } else {
12 setProperty("reminderOutput", "text", inputList[index]);
setProperty(id, property, value13 setProperty("countOutput", "text", index + 1);
14 }
getProperty(id, property) 15 }
16 onEvent("leftButton", "click", function( ) {
17 if (index > 0) {
18 index = index - 1;
19 updateScreen();
20 }
21 });
0 22
23
onEvent("rightButton", "click", function( ) {
if (index < inputList.length - 1) {
24 index = index + 1;
25 updateScreen();
26 }
New reminder Add 27 });
28

Run


 Show Debug Commands Debug Console  Clear Watchers 
 English © Version: 2022

You might also like