alice-teacher Do in order scope issue in Alice 3

Melanie Lam mjyee at andrew.cmu.edu
Wed May 18 12:50:12 EDT 2022


Can you declare them outside of the ‘do in order’ and then assign them values inside?

It’s my understanding that if you declare variables within any of the control blocks like while/if/do together - they will be local to that block of code unless declared in the method.

Thanks,
Melanie


Sent from my iPhone

> On May 18, 2022, at 9:40 AM, Carlos Bovell via alice-teachers <alice-teachers at lists.andrew.cmu.edu> wrote:
> 
> 
> Hi,
> 
> In Alice 3, the do in order control structure limits scope. Is there a reason for that? In the attached screenshot, the variable outside the do in order can't be assigned any of the variables' values that were declared inside the do in order.
> 
> Carlos
> 
> 
> _______________________________________________
> 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/20220518/b010d33c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 142318 bytes
Desc: not available
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20220518/b010d33c/attachment-0001.png>


More information about the alice-teachers mailing list