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

#1 2010-05-29 09:59:44

Keani
Scratcher
Registered: 2009-08-15
Posts: 39

Power Operator

Hello, again :)

I am right now trying to create a decimal-hex, hex-decimal program on scratch, but there is one limitation stopping me. There is no power operator, well there is but it can only be the power of e and the power of 10, therefore I cant make this program. It would be helpfull if there was a block looked like this: http://www.puffleland.myadopts.com/picuploads/gif/c1c7aaf77b0063cf4285fa44bdaca05f.gif
Would it be possible?
Keani.


http://internetometer.com/image/9932.png

Offline

 

#2 2010-05-29 10:04:41

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

Re: Power Operator

I'm surprised we don't have this already! It would make a great addition to the program - I definitely support. For now, you can just use something along the lines of this, where y is the number, x is the exponent, and z is the result:

Code:

set z to (1)
repeat (x)
  set z ((z) * (y))
end

That would effectively give you the result, but I admit your block would definitely be a lot better.

Offline

 

#3 2010-05-29 10:07:14

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Power Operator

I do agree, that is a block that should be in scratch.

Here's a thread explaining how to do it, with other blocks  smile

http://scratch.mit.edu/forums/viewtopic.php?pid=343511


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

Offline

 

Board footer