alice-teacher Problem with INT function??

Don Slater dslater at andrew.cmu.edu
Mon Aug 12 07:51:12 EDT 2013


The comparison seems to work on the very latest release (as of last week) of Alice 2.3, now available for download at www.alice.org. At least when I run it on my MacBook Pro. See the attached world and the attached screen shot…

You will see that I did the comparison in two ways, using a variable with the int form of the value the user entered, and doing the comparison the the inline conversion of the value the user entered…

Frankly, I would not have been surprised if it did not work, as comparison of real numeric values for equality is always problematic in programming, for the reasons of type alluded to in an earlier post by Claude Gueganno.

But at the moment, I do not seem too be encountering the problems that you have discovered. However, if you run the attached world on your machine, with the latest download, and it does not work, please let me know, and also let me know the OS version of Alice you are running.

Please let me know if you have any other questions or comments.

All the best,
Don Slater


On Aug 11, 2013, at 12:23 PM, Deane Fistick <deane.fistick at ecotoh.org> wrote:

> Hi Don,
>  
> I recently downloaded Alice 2.3.5 preparing for the coming school year. I was pleased to see that the INT function (in advanced math) is now a number rather than a string.
>  
> However I had some trouble getting it to work properly. I was teaching the kids how to check to make sure the user had entered a whole number when asked.
>  
> If NumberEntered = Int(NumberEntered) should be true if a whole number is entered – but that doesn’t seem to work.
>  
> I did figure out a “work around” by rearranging the equation.
>  
> If NumberEntered – Int(NumberEntered) = 0 seems to work OK.
>  
> Although we have a “work around”, the first If statement is the most straight forward, logical approach, and I would like to use it if possible.
>  
> Do you know of any reason why the first If statement shouldn’t work?
>  
> I’ve attached a copy of the relevant part of my lesson, which includes more detail and pictures that may help.
>  
> Thanks,
> Deane Fistick
> ECOT (Electronic Classroom Of Tomorrow)
> <Int_Function_Problem.docx>_______________________________________________
> 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: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20130812/c4b909d5/attachment-0003.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NumberComparison.a2w
Type: application/octet-stream
Size: 1017027 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20130812/c4b909d5/attachment-0001.obj 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20130812/c4b909d5/attachment-0004.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NumberComparisonScreenShot.png
Type: image/png
Size: 336829 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20130812/c4b909d5/attachment-0001.png 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20130812/c4b909d5/attachment-0005.html 


More information about the alice-teachers mailing list