Latest posts on Power blockhttps://scratch.mit.edu/discuss/topic/15646/2018-10-18T19:59:27+00:00About Scratch :: Suggestions :: Power block
2018-10-18T19:59:27+00:00ScratchDiogoh3285709<blockquote><p class="bb-quote-author">HappyMohid wrote:</p><pre class="blocks"><() ^ () = ()></pre><br/>so hard<br/><br/><br/><pre class="blocks">if <(1) ^ (1) = (10)> </pre><br/><pre class="blocks">when <(1) ^(1) = (10)> </pre></blockquote>What is hard, too? also make a new topic
About Scratch :: Suggestions :: Power block
2018-10-18T19:21:36+00:00HappyMohid3285661<pre class="blocks"><() ^ () = ()></pre><br/>so hard<br/><br/><br/><pre class="blocks">if <(1) ^ (1) = (10)> </pre><br/><pre class="blocks">when <(1) ^(1) = (10)> </pre>
About Scratch :: Suggestions :: Power block
2018-02-11T11:59:40+00:00thesuperscratchcat142989116Fun facts: 10^3 = 10 * 10 * 10 = 1,000<br/>Exponentiation is a mathematical operation, written as bn, involving two numbers, the base b and the exponent n. When n is a positive integer, exponentiation corresponds to repeated multiplication of the base: that is, bn is the product of multiplying n bases:<br/><br/>The exponent is usually shown as a superscript to the right of the base. In that case, b to the power of n is called “b raised to the nth power”, “b raised to the power of n”, or “the n-th power of b”.<br/><br/>When n is a positive integer and b is not zero, b−n is naturally defined as <br/>1/ b to the power of n, preserving the property b to the power of n × b to the power of m = b to the power of n + m. With exponent −1, b to the power of -1 is equal to 1/b, and is the reciprocal of b. (BTW I got this from <span>Wikipedia</span>)
About Scratch :: Suggestions :: Power block
2017-12-20T01:51:03+00:00CodeBit2929703<blockquote><p class="bb-quote-author">walkcycle wrote:</p><blockquote><p class="bb-quote-author">CodeBit wrote:</p>Scratch's left side of the screen has a negative x coordinate. Can anybody solve this? </blockquote>the <a href="https://wiki.scratch.mit.edu/wiki/Abs_of_%28%29_%28Operators_block%29#Functions">abs</a> operator makes a negative value positive<br/><br/>try<br/><br/><pre class="blocks">set [base v] to ([abs v] of (x position))</pre><br/><a href="https://scratch.mit.edu/discuss/7/">Help With Scripts</a> for more problems (this is the suggestions forum)</blockquote><br/>But would that make it follow the curve? Thanks anyway, I'll try it later!<br/><br/>EDIT: Yep, it worked! Thanks!
About Scratch :: Suggestions :: Power block
2017-12-20T01:33:48+00:00smartzx2929685<blockquote><p class="bb-quote-author">savaka wrote:</p><blockquote><p class="bb-quote-author">scratchisthebest wrote:</p>by this logic, we can remove “move (10) steps”<br/><br/>why not just use<br/><pre class="blocks">go to x: ((x position) + ([cos v] of ((direction)*(amt)))) y ((x position) + ([sin v] of ((direction)*(amt))))</pre>i mean jeez so simple</blockquote>It's not simple. Scratch is supposed to be easy to use. Not everyone knows trigonometry.<blockquote><p class="bb-quote-author">xlk wrote:</p>and while we are at it, the “wait” block is also unnecessary, as you can use the timer for it.<br/>BTW, I remember reading somewhere that scratch's blocks are faster than a series of blocks doing the same, so (()^()) would be technically speaking faster than doing logarithms. I mean, is it that hard to add scratchteam?</blockquote>You could, but that would make less sense, and it's supposed to be easy to use.</blockquote><blockquote><p class="bb-quote-author">PkmnQ wrote:</p><blockquote><p class="bb-quote-author">scratchisthebest wrote:</p>by this logic, we can remove “move (10) steps”<br/><br/>why not just use<br/><pre class="blocks">go to x: ((x position) + ([cos v] of ((direction)*(amt)))) y ((x position) + ([sin v] of ((direction)*(amt))))</pre>i mean jeez so simple</blockquote>how is that simple?<br/>you should've used<br/><pre class="blocks">change x by ()</pre>as the easy workaround block.<br/>still, your point is good.</blockquote>They were being sarcastic
About Scratch :: Suggestions :: Power block
2017-12-20T00:59:41+00:00walkcycle2929668<blockquote><p class="bb-quote-author">CodeBit wrote:</p>Scratch's left side of the screen has a negative x coordinate. Can anybody solve this? </blockquote>the <a href="https://wiki.scratch.mit.edu/wiki/Abs_of_%28%29_%28Operators_block%29#Functions">abs</a> operator makes a negative value positive<br/><br/>try<br/><br/><pre class="blocks">set [base v] to ([abs v] of (x position))</pre><br/><a href="https://scratch.mit.edu/discuss/7/">Help With Scripts</a> for more problems (this is the suggestions forum)
About Scratch :: Suggestions :: Power block
2017-12-19T23:41:15+00:00Charles123102929587I really think this idea would be very useful!<br/><br/><blockquote>No, there is a workaround.<br/><br/><pre class="blocks">([10^ v] of ((power) * ([log v] of (number))) :: operators )</pre><br/>Enough said.<br/></blockquote>1. This workaround doesn't work with negative numbers. Adding a script to return the result for negative numbers adds more complexity to workarounds.<br/>2. Logarithms are mostly taught starting at either the end of Middle school or at the beginning of secondary school.
About Scratch :: Suggestions :: Power block
2017-12-19T21:43:35+00:00CodeBit2929473I have been trying to graph functions with a project, and it appears that an object cannot move in a curve if moving towards the left. It only follows the instructions if the x position is greater than 0, but Scratch's left side of the screen has a negative x coordinate. Can anybody solve this? I have used the way using logarithms…<br/><br/>Currently the script can draw a curve this way:<br/><br/><pre class="blocks">when green flag clicked<br/>forever<br/>change x by (1)<br/>set [ base ] to (x position)<br/>set [ power ] to [ 2 ]<br/>set y to ((0.01) * ([ e^ v] of ((power) * [ ln v] of (base)))<br/>pen down<br/>end</pre>
About Scratch :: Suggestions :: Power block
2017-07-22T23:39:23+00:00Jonathan502737759<blockquote><p class="bb-quote-author">dvargasews wrote:</p>First of all, <a href="https://scratch.mit.edu/projects/132510924/#fullscreen">not directly…</a></blockquote>I know you can use them in Scratch but Scratch still doesn't support them.<br/><blockquote>Second, even though <span class="bb-italic">most</span> Scratch members don't use imaginary numbers, they're still good for stuff like projecting 4D objects and quantum wave simulators.</blockquote>Scratch doesn't support imaginary numbers, so they're a user data type and none of the primitive operations do or can be expected to work on them anyways <img src="//cdn.scratch.mit.edu/scratchr2/static/__445e6d1effe21b688a56233447df2051__/djangobb_forum/img/smilies/tongue.png" /><br/><blockquote>Third, you still haven't addressed the part about how it gets inaccurate when working with really small numbers.</blockquote>Yes, because that's an actual problem with the workaround and I didn't mean to address it.
About Scratch :: Suggestions :: Power block
2017-07-22T23:33:13+00:00dvargasews2737755<blockquote><p class="bb-quote-author">Jonathan50 wrote:</p><blockquote><p class="bb-quote-author">dvargasews wrote:</p>The second only works with real numbers and gets inaccurate with small values.</blockquote>Scratch doesn't support imaginary numbers so it doesn't matter…</blockquote>First of all, <a href="https://scratch.mit.edu/projects/132510924/#fullscreen">not directly…</a><br/>Second, even though <span class="bb-italic">most</span> Scratch members don't use imaginary numbers, they're still good for stuff like projecting 4D objects and quantum wave simulators.<br/>Third, you still haven't addressed the part about how it gets inaccurate when working with really small numbers.
About Scratch :: Suggestions :: Power block
2017-07-22T23:27:39+00:00Jonathan502737748<blockquote><p class="bb-quote-author">dvargasews wrote:</p>The second only works with real numbers and gets inaccurate with small values.</blockquote>Scratch doesn't support imaginary numbers so it doesn't matter…
About Scratch :: Suggestions :: Power block
2017-07-22T23:22:34+00:00dvargasews2737744<blockquote><p class="bb-quote-author">Charles12310 wrote:</p>Workaround:<br/><br/><pre class="blocks">define find (base)^(power)<br/>set [number v] to (base)<br/>repeat ([abs v] of (power))<br/>set [number v] to ((number) * (base))<br/>end<br/>if <(power) < (0)> then<br/>set [number v] to ((1)/(number))<br/>end</pre><br/>Alternatives:<br/><br/><pre class="blocks">([10^ v] of ((power) * ([log v] of (base))) :: operators )<br/><br/>([e^ v] of ((power) * ([ln v] of (base))) :: operators )</pre></blockquote>The first only works with integer powers.<br/>The second only works with real numbers and gets inaccurate with small values.
About Scratch :: Suggestions :: Power block
2017-07-22T01:20:40+00:00Charles123102736450Workaround:<br/><br/><pre class="blocks">define find (base)^(power)<br/>set [number v] to (base)<br/>repeat (([abs v] of (power)) - (1))<br/>set [number v] to ((number) * (base))<br/>end<br/>if <(power) < (0)> then<br/>set [number v] to ((1)/(number))<br/>end</pre><br/>Alternatives:<br/><br/><pre class="blocks">([10^ v] of ((power) * ([log v] of (base))) :: operators )<br/><br/>([e^ v] of ((power) * ([ln v] of (base))) :: operators )</pre>
About Scratch :: Suggestions :: Power block
2017-07-21T21:50:50+00:00dvargasews2736281<blockquote><p class="bb-quote-author">DIAMOND_77 wrote:</p>if you want to say do 3^3 you just do this: ((3)*(3) *(3)) just put an operator in an operator!</blockquote>But what if the power is variable? Like<pre class="blocks">((2) ^ (number of lives left) ::operators reporter)</pre>? One could use a repeat block, but that wouldn't work for non-integer exponents, like<pre class="blocks">((2) ^ (batting average) ::operators reporter)</pre>.
About Scratch :: Suggestions :: Power block
2017-06-14T21:17:12+00:00stickfiregames2677323<blockquote><p class="bb-quote-author">DIAMOND_77 wrote:</p>there is a work around</blockquote>So how would you do 4 ^ 1.5 with that workaround? I think you'll find you can't.