alice-teacher Problem with INT function??

Deane Fistick deane.fistick at ecotoh.org
Mon Aug 12 12:44:13 EDT 2013


Thanks Don.

I read Claude’s explanation as well. I downloaded the newest version of Alice and even in the simplest form, the input = int(input) still doesn’t work.  I even rewrote the program to like yours. (see below).

The REALLY STRANGE thing is that the program you sent (made on your Mac) works on the old AND the new version of Alice running Windows.

[cid:image001.png at 01CE9759.A81C6600]

For now, I’ll need to offer the alternate version of the comparison. Most of my students have Windows machines.

Thanks,
Deane
From: alice-teachers-bounces+deane.fistick=ecotoh.org at lists.andrew.cmu.edu [mailto:alice-teachers-bounces+deane.fistick=ecotoh.org at lists.andrew.cmu.edu] On Behalf Of Don Slater
Sent: Monday, August 12, 2013 7:51 AM
To: Alice educators
Subject: Re: alice-teacher Problem with INT function??

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<http://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
[cid:image002.png at 01CE9759.A81C6600]

On Aug 11, 2013, at 12:23 PM, Deane Fistick <deane.fistick at ecotoh.org<mailto: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<mailto: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/ca2c4308/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 112707 bytes
Desc: image001.png
Url : http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20130812/ca2c4308/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 336829 bytes
Desc: image002.png
Url : http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20130812/ca2c4308/attachment-0003.png 


More information about the alice-teachers mailing list