Skip to content

Lists#

The same rules apply to lists as they do to variables. You can declare a list for all sprites in stage.gs, for this sprite only in the sprite's .gs file. There are no local lists.

Delete all items from a list#

This statement is considered the declaration of a list.

delete list;

Delete item at index from a list#

delete list[index];

Delete last item of list#

delete list["last"];

Add item to list#

add item to list;

Insert item at index in list#

insert item at list[index];

Replace item at index in list#

list[index] = item;

Apply operator to item at index in list#

list[index] += 1;
list[index] -= 1;
list[index] *= 1;
list[index] /= 1;
list[index] // = 1; # Floor Division
list[index] %= 1;
list[index] &= "suffix";

Get item at index from list#

say list[index];

Get last item of list#

say list["last"];

Get length of list#

say length list;

Get index of item in list#

TODO

Check if list contains item#

say item in list;

Show list monitor#

show list;

Hide list monitor#

hide list;