Ok! I finally found out how to access alice lists with jython! just type edu.cmu.cs.stage3.alice.core.List. then insert your action from the following:
Code:
clear
contains
containsValue
empty
firstIndexOfItem
firstIndexOfItemValue
insertItemAtBeginning
insertItemAtEnd
insertItemAtIndex
insertItemValueAtBeginning
insertItemValueAtEnd
insertItemValueAtIndex
isEmpty
itemAtBeginning
itemAtEnd
itemAtIndex
itemAtRandomIndex
itemValueAtBeginning
itemValueAtEnd
itemValueAtIndex
itemValueAtRandomIndex
lastIndexOfItem
lastIndexOfItemValue
removeItemFromBeginning
removeItemFromEnd
removeItemFromIndex
size
then comes your parameters inside of (). The first is your list, like world.list, and the others if there are any are the other options, such as insert item at end having the item to be inserted. An example - The argument is the list that needs to be sorted:
Code:
def sort(list):
a=[]
for i in range(edu.cmu.cs.stage3.alice.core.List.size(list)):
a.append(edu.cmu.cs.stage3.alice.core.List.itemValueAtIndex(list,i))
a.sort()
edu.cmu.cs.stage3.alice.core.List.clear(list)
for i in a:
edu.cmu.cs.stage3.alice.core.List.insertItemValueAtEnd(list,i)
Forget for all in order! jython can access lists hundreds of times faster than alice!