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

#1 2010-09-11 11:25:06

IHeartGaming
Scratcher
Registered: 2010-07-23
Posts: 1000+

___ to ___ block

like -420 to 420

IHG


IHeartGaming

Offline

 

#2 2010-09-11 11:26:17

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

Re: ___ to ___ block

I'm sorry... I don't fully understand what you're trying to say? Are you asking how to make a negative number positive, or vice versa?

Just multiply by -1  smile

Offline

 

#3 2010-09-11 11:29:22

roger-
Scratcher
Registered: 2010-02-13
Posts: 100+

Re: ___ to ___ block

are you thinking of the pick random from () to () block? cause they already have that....


Food is Fat. Fat is power.
        I am almighty.

Offline

 

#4 2010-09-11 11:30:51

IHeartGaming
Scratcher
Registered: 2010-07-23
Posts: 1000+

Re: ___ to ___ block

no, i mean a <number TO number> block, like
9 to 78
in boolean (or whatever those <------> blocks are)


IHeartGaming

Offline

 

#5 2010-09-11 11:32:06

IHeartGaming
Scratcher
Registered: 2010-07-23
Posts: 1000+

Re: ___ to ___ block

@roger-
I don't think that is it...


IHeartGaming

Offline

 

#6 2010-09-11 11:35:23

demosthenes
Retired Community Moderator
Registered: 2008-02-19
Posts: 1000+

Re: ___ to ___ block

Do you mean a boolean for a range of values?

You can do that with

Code:

[if << (Variable) is less than (Value)>> and << (Variable) is greater than (Value)>>

My psuedocode is a little confusing so if you don't understand just ask and I'll post a screenshot  smile

Last edited by demosthenes (2010-09-11 11:36:00)


I've taken a long hiatus, but I still visit sometimes. Give me some time to answer any messages you post on my projects!

Offline

 

#7 2010-09-11 11:36:32

IHeartGaming
Scratcher
Registered: 2010-07-23
Posts: 1000+

Re: ___ to ___ block

yep! (please post screenshot)
Thanks!

Last edited by IHeartGaming (2010-09-11 11:37:55)


IHeartGaming

Offline

 

#8 2010-09-11 11:54:15

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: ___ to ___ block

http://i55.tinypic.com/negkno.gif
(The code demosthenes posted, in Scratch blocks.)
This checks if the value is in the range of numbers between min and max. (exclusive)


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#9 2010-09-11 12:32:48

colorfusion
Scratcher
Registered: 2009-10-03
Posts: 500+

Re: ___ to ___ block

Do you want to suggest the block or know how to do it?
If you want to know how, look at harakous post.
If its a suggestion, ask a moderator to move this to suggestions.

Offline

 

#10 2010-09-11 21:52:34

cpumaster930
Scratcher
Registered: 2009-02-23
Posts: 100+

Re: ___ to ___ block

'k this is confusing


http://i.imgur.com/Qd0lu.png

Offline

 

#11 2010-09-11 22:58:55

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: ___ to ___ block

What do you mean.


For count -420 to 420
          Move count steps
Next

That will choose every number from -420 to 420 (-420,-419,-418,-417 ect). Is this what you mean?

http://img203.imageshack.us/img203/5152/forcountblock.png
Now that is a awesome block that I just created. (run it make sure lower count is less than upper count)

Last edited by what-the (2010-09-11 23:08:56)


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

#12 2010-09-12 11:18:30

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: ___ to ___ block

what-the wrote:

What do you mean.


For count -420 to 420
          Move count steps
Next

That will choose every number from -420 to 420 (-420,-419,-418,-417 ect). Is this what you mean?

http://img203.imageshack.us/img203/5152 … tblock.png
Now that is a awesome block that I just created. (run it make sure lower count is less than upper count)

Maybe you should have read the entire thread.  tongue  What is that even supposed to do?


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#13 2010-09-13 05:26:53

what-the
Scratcher
Registered: 2009-10-04
Posts: 1000+

Re: ___ to ___ block

Harakou wrote:

what-the wrote:

What do you mean.


For count -420 to 420
          Move count steps
Next

That will choose every number from -420 to 420 (-420,-419,-418,-417 ect). Is this what you mean?

http://img203.imageshack.us/img203/5152 … tblock.png
Now that is a awesome block that I just created. (run it make sure lower count is less than upper count)

Maybe you should have read the entire thread.  tongue  What is that even supposed to do?

Make it it's really cool. Set lower to -15 and upper to 15 or something simular. What it does is it chooses every number from the number you say to the other number you say in this case -15 to 15 which will be.

-15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Or even better make this.
http://img214.imageshack.us/img214/7127/testsss.png


http://imageshack.us/m/64/9034/ddfss.pngMy site
Find someone post count. Click posts under username. Find number of pages. Times that by 40 for min and 60 for max and you have a rough estimate of post count.

Offline

 

Board footer