Alice Community  

Go Back   Alice Community > Educators > Teaching with Alice

Thread Tools Display Modes
Array not working
Posts: n/a
Default Array not working - 12-27-2009, 11:25 AM

I can't get the array function to work. I have been following Chapter 10 of my textbook, but when I copy the elements over to the array function, it doesn't copy like it should. What am I doing wrong? I need to get this done for an assignment. I have included what I have done so far. Thanks in advance for any help you can give me.
Attached Files
File Type: a2w Kathy Powell-Week 4 Individual Asgmt.a2w (2.78 MB, 13 views)
Reply With Quote
Senior Member
MrMoke's Avatar
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default Suggestion - 12-28-2009, 10:15 AM

It might be easier to create the array as a variable inside of your method.

Also, the purpose of using the array is minimize the coding, so the events area should have only one entry which passes whatWasPicked() to your routine when <anything> is clicked. Your routine then decides whether the clicked object is an element in the local array variable, and takes the appropriate action.

Think "if" inside of a "for"
Reply With Quote
Working with Arrays
Senior Member
meirs's Avatar
Status: Offline
Posts: 64
Join Date: Dec 2009
Location: Universe
Default Working with Arrays - 02-14-2010, 07:41 AM

Note that arrays have some serious bugs in Alice - non-object arrays (of numbers, strings, booleans) do not work properly (if you're using Alice2.0 then you should know that some of these bugs were fixed in Alice 2.2, although that's not being specified in the Alice 2.2 changes notes

Mama is an Alice On Steroids with YouTube uploader, 3d object creator, tutorial editor, and standalone support:
Reply With Quote
Senior Member
zonedabone's Avatar
Status: Offline
Posts: 578
Join Date: Nov 2008
Location: In the interwebs
Default 02-17-2010, 05:22 PM

Oooh! Sneaky, MrMoke!

I like the wink afterwards.

'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

Thread Tools
Display Modes

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 ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.