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

#1 2011-01-11 08:07:15

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

floor

Is there a floor command in smalltalk? I basically need to round number to the nearest whole number that is less than it as oppose to the round command which rounds it to the nearest whole number regrardless if it's higher or lower?

I tried this:

t1_ floor: t1

but it didn't work so either the command isn't called floor, there isn't one at all or I used the wrong syntax.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#2 2011-01-11 09:19:32

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: floor

Ha! You didn't give a receiver for the command "floor". Should a String do this? Or a SmallInteger? Use: "t1 _ t1 floor".


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#3 2011-01-11 10:30:55

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: floor

Thanks! Does anyone know a command to change the rotation centre of a sprite?  smile


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#4 2011-01-11 10:50:06

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: floor

Uh...

Code:

self rotationCenter: (x@y)

http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#5 2011-01-11 10:52:06

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: floor

smile   smile   smile   smile


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#6 2011-01-11 10:59:15

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: floor

This has become the "Help Sparks Thread!"  tongue


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#7 2011-01-11 11:24:37

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: floor

Maybe I should rename it as that  tongue


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#8 2011-01-11 11:30:03

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: floor

Good idea!


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

Board footer