alice-teacher For All Together checking a list

James Vanderhyde jvanderhyde at benedictine.edu
Tue May 17 14:36:35 EDT 2011


Try "for all in order" instead of "for all together". I have seen that work better for things like this. Logically both should work, but it seems like "for all together" doesn't work with "if then" the way we would expect.

James
--
Dr. James Vanderhyde
Math and Computer Science
Benedictine College
jvanderhyde at benedictine.edu
http://vanderhyde.us/~james/pro/



On May 16, 2011, at 7:13 PM, Susan Simonson wrote:

> I have a student with the following question:
>  
> We are trying to create a racing game in which we use invisible boxes to keep the car at a regular speed on the road, while it has a lower speed and can stop completely off the road. We used a "for all together" statement within an infinite loop using a list with all the boxes inside the list. We then use a "if then" inside the "for all together" statement and declare a variable we are watching true if it is in the box and false if it is not. The problem we are having is that the statement only recognizes the first item in the list, and we want to have it recognize all the boxes. Please help us with suggestions.  Thanks! 
> 
> 
> Sue Simonson
> Business/Computer Education Teacher
> DECA Advisor
> Link Crew Advisor
> Mound Westonka High School
> (952) 491-8169
> simonsons at westonka.k12.mn.us 
> 
> www.westonka.k12.mn.us 
> The Westonka Edge: Small School Advantages; Big School Opportunities; Real-Life Success Stories
> 
> _______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.andrew.cmu.edu/mailman/private/alice-teachers/attachments/20110517/77933fae/attachment.html 


More information about the alice-teachers mailing list