alice-teacher Alice 2 "move toward" bug

Vanderhyde, James vanderhyde at sxu.edu
Mon Mar 4 13:26:09 EST 2019


I am experiencing what I think is a bug in Alice 2 in the “move toward” instruction. See attachment. Here is the code:
  bunny move ( bunny distance to chicken ) toward target = chicken
This should move the bunny right onto the chicken, and it does, unless the chicken is moving. When the chicken is moving, even if it’s moving very slowly, the bunny does not move far enough. It should do the same thing as “bunny move to chicken,” but it doesn’t.

I am guessing there is special logic in the implementation of “move toward” for when the target object is moving, and there is an error in the calculation in that case. I am guessing maybe a unit vector is used instead of a vector scaled by the speed.

James
—
James Vanderhyde
Assistant Professor and Department Chair, Computer Science
Saint Xavier University
3700 W. 103rd St.
Chicago, IL 60655
773-298-3454
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20190304/bc857ae6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bunny move toward chicken.a2w
Type: application/octet-stream
Size: 375401 bytes
Desc: bunny move toward chicken.a2w
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20190304/bc857ae6/attachment-0001.obj>


More information about the alice-teachers mailing list