alice-teacher Compare colors

Don Slater dslater at andrew.cmu.edu
Mon Oct 27 11:59:44 EDT 2014


You are correct… It is not possible at this time in Alice 3 to check to see if an object has a specific color or paint value.

The only workaround that I can suggest, and it is not pretty, is to create a string variable for the object class that will hold the color name (i.e. “blue”) and then compare that string against your target value. But this will require that every time you change the color of an object, the object variable also has to be changed.

I am sorry,
Don Slater

> On Oct 27, 2014, at 11:36 AM, John De Maesschalck <johndm at ikso.be> wrote:
> 
> Hey
> 
> I used to work with Alice 2 in my class. It was very easy to check if an object had a specific color.
> This year I'm trying to use Alice 3.
> 
> I'm having problems using the if-statement and colors.
> 
> Even a simple variable of type color can't be used in the if-statement condition.
> 
> How must one use colors in the if-statement?
> _______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers



More information about the alice-teachers mailing list