Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
The hack!!!!!
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 577
Join Date: Nov 2008
Location: In the interwebs
Default The hack!!!!! - 06-06-2010, 07:45 PM

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!


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Default 06-06-2010, 09:27 PM

yeh! well done, so far ive only managed to append them and remove stuff from them


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [¬º-°]¬
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 06-06-2010, 10:54 PM

Just so you know...

YOU ROCK, ZONE!


(')>
   
Reply With Quote
Old
Niteshifter
Guest
 
Status:
Posts: n/a
Default 06-07-2010, 12:28 AM

This'll be quite useful for future projects. Nice find .
   
Reply With Quote
Thanks!
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 577
Join Date: Nov 2008
Location: In the interwebs
Default Thanks! - 06-07-2010, 03:23 PM

Yep! I'm finding a ton of stuff, like making custom colors during the world's execution.


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
Reply

Tags
zonedabone


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.