This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-06-30 04:20:31

onedudeuk
Scratcher
Registered: 2009-01-11
Posts: 100+

X=(whole number)

Hi

In scratch 1.4 RC is there a (IF (X/F=*WHOLE NUMBER*) ...

Thanks

Ben


http://i.imgur.com/1FaX3.gif
http://i.imgur.com/yu0s1.gif

Offline

 

#2 2009-06-30 04:47:20

BoltBait
Scratcher
Registered: 2009-03-09
Posts: 1000+

Re: X=(whole number)

No, but you can do it this way:

if (X/F) = round(X/F)
then whole number
else not whole number

You can see that type of stuff in these projects:

http://scratch.mit.edu/projects/BoltBait/515051
http://scratch.mit.edu/projects/BoltBait/516292

Last edited by BoltBait (2009-06-30 04:49:05)


Animated sigs must be banned!
http://boltbait.com/j.pnghttp://boltbait.com/s.pnghttp://boltbait.com/d.pnghttp://boltbait.com/a.pnghttp://boltbait.com/p.png

Offline

 

#3 2009-06-30 05:26:54

onedudeuk
Scratcher
Registered: 2009-01-11
Posts: 100+

Re: X=(whole number)

Thanks  big_smile


http://i.imgur.com/1FaX3.gif
http://i.imgur.com/yu0s1.gif

Offline

 

#4 2009-07-03 16:14:59

scmb1
Scratch Team
Registered: 2009-03-19
Posts: 1000+

Re: X=(whole number)

Or you could do if x mod 1 = 0
                        whole number
                        else not whole number


http://i48.tinypic.com/2z5pqad.png

Offline

 

#5 2009-07-03 16:48:17

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: X=(whole number)

I prefer scmb1's version of things because it teaches a lot more. It's more mathematically correct, plus it's easier.

Offline

 

Board footer