Adding elements to a list without generating a new list

MrChadd shared this question 8 months ago
Answered

I am working on creating a interactive math project for my students focused around modular arithmetic. I want the students to be able to be able to create a list of values that all generate a given number, for example in mod 4 the numbers 1,5,9,13,17 all equal 1. As the students interact with sliders to generate new values I want them to be able to click a button to submit those values to a static list. I am struggling with geogebra because when adding additional information to a given list it always ends up creating a new list. How can I avoid this.

When I use Append ( list_name, element ) it generates a new list

Is this concept supported by Geogebra?

Comments (2)

photo
1

your list must be defined as free (for example: l1={})

then you can use the command: SetValue(l1, n, <value>)

n is the list-index (where maxValue = Length(l1)+1)

<value> can be a list of the 5 sliders but you must use CopyFreeObject(<value>) so the connection to the sliders is broken

Attached a sample with a bit more then you ask

Try to make one InputBox more in the sample: Update a line.

The script for this is near the script in "Save Values" but not use "Length(l1)+1" instead use the value from a InputBox similare as Delete Line

© 2019 International GeoGebra Institute