alice-teacher A number list is being filled with booleans

Donald Slater djslater107 at mac.com
Wed Jan 26 10:00:22 EST 2022


Thank you, Carlos and James for cat=ching this bug. It is a bug in Alice, and I am pretty sure that it has something to do with the int function.

When I simply assign an int(1) to a number variable, the value ends up as true, per James explanation below.

I have passed this bug report onto the dev team, along with my copy of the project.

Thank you, again,

Don Slater
Alice Project




> On Jan 25, 2022, at 5:16 PM, Vanderhyde, James <vanderhyde at sxu.edu> wrote:
> 
> It seems to be the int function that is causing the problem. This bug is easy to reproduce (see attached screenshot). If you use floor instead of int, the result is a number, as expected. So I recommend you tell the student to use floor instead of int.
> 
> The values from int are correct, if you assume false==0 and true==1. There must be a bug in Alice that is converting the output of the int function into a Boolean for those two cases.
> 
> James
>> James Vanderhyde
> Associate Professor
> Computer Science
> Saint Xavier University
> 3700 W. 103rd St.
> Chicago, IL 60655
> 773-298-3454
> <Screen Shot 2022-01-25 at 4.12.24 PM.png>
> On Jan 25, 2022, at 1:04 PM, Donald Slater via alice-teachers <alice-teachers at lists.andrew.cmu.edu <mailto:alice-teachers at lists.andrew.cmu.edu>> wrote:
> 
> Carlos,
> I am not sure where those boolean values are coming from. Perhaps run a loop before actually beginning the work in which all elements in the lists are initialized to 0 to start. (In there words do not rely on whatever initialization Alice does when you set up the list.)
> 
> Then as you are watching the variables, slow things down by putting a wait statement after each statement that updates the list so that you can see exactly what is going on.
> 
> Please keep us posted and let us know if you have any questions.
> 
> All the best,
> Don Slater
> 
> Alice Project
> 
> 
>> On Jan 25, 2022, at 11:33 AM, Carlos Bovell via alice-teachers <alice-teachers at lists.andrew.cmu.edu <mailto:alice-teachers at lists.andrew.cmu.edu>> wrote:
>> 
>> Hi,
>> 
>> We have a project where I'm asking the students to make change and output how many 20s, how many 10s, etc will be needed to make the change. A student is trying to fill a number list with the quotients and getting some weird results that gets in the way of his being able to use the quotients elsewhere in his project. This is what we see when we "watch the variables" (see below). Note that two of the elements in the list appear as booleans. Could that be what is causing elsewhere later on when he tries to use these values as numbers?
>> 
>> Thanks for taking my question.
>> 
>> Carlos Bovell
>> Northern Burlington High School
>> 
>> <image.png>
>> _______________________________________________
>> alice-teachers mailing list
>> alice-teachers at lists.andrew.cmu.edu <mailto:alice-teachers at lists.andrew.cmu.edu>
>> To change settings or unsubscribe visit:
>> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers <https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.andrew.cmu.edu%2Fmailman%2Flistinfo%2Falice-teachers&data=04%7C01%7Cvanderhyde%40sxu.edu%7C338b2e699c0e4e6fc80508d9e035b98b%7Cfe272ab3cfce455f9427088b59a13be5%7C0%7C0%7C637787343631685138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=C4%2B%2Fi%2FK8l8p4b27ZFt9LT81rKI3edji%2B7f3t2s%2BDXXg%3D&reserved=0>
> _______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu <mailto:alice-teachers at lists.andrew.cmu.edu>
> To change settings or unsubscribe visit:
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers <https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers>
> _______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> To change settings or unsubscribe visit:
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20220126/2d2d0815/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ListProcess.a2w
Type: application/octet-stream
Size: 186116 bytes
Desc: not available
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20220126/2d2d0815/attachment-0001.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20220126/2d2d0815/attachment-0003.html>


More information about the alice-teachers mailing list