Discuss Scratch

djollieboy11
Scratcher
9 posts

How to do exponents?

I am working on how to make exponents, and I found that their is no exponent block. would somebody be able to help me do this? This is my code so far:
whenclickedforeversetnumber onetopickrandom3to10setnumber twotopickrandom3to10setexponenttopickrandom0to5setsum of exponents and second numbertonumber twoifnotexponent=0orexponent=1thenrepeatexponentsetsum of exponents and second numbertosumofexponentsandsecondnumber*numbertwosetsum of exponents and second numbertosumofexponentsandsecondnumber/numbertwosetsum of equationtosumofexponentsandsecondnumber*numberoneelseifexponent=0thensetsum of equationto1elseifexponent=0thensetsum of equationtonumberone*numbertwo

after all of that, I have an ask script that asks the player what the answer is, but I can't add that because the way I entered this didn't have the blocks.
also, this took forever to make, since I had to type this out and learn this new language that is only in the forums.

Last edited by djollieboy11 (March 11, 2025 14:55:20)

Cool_Dude2022
Scratcher
500+ posts

How to do exponents?

djollieboy11 wrote:

I am working on how to make exponents, and I found that their is no exponent block. would somebody be able to help me do this? This is my code so far:
whenclickedforeversetnumber onetopickrandom3to10setnumber twotopickrandom3to10setexponenttopickrandom0to5setsum of exponents and second numbertonumber twoifnotexponent=0orexponent=1thenrepeatexponentsetsum of exponents and second numbertosumofexponentsandsecondnumber*numbertwosetsum of exponents and second numbertosumofexponentsandsecondnumber/numbertwosetsum of equationtosumofexponentsandsecondnumber*numberoneelseifexponent=0thensetsum of equationto1elseifexponent=0thensetsum of equationtonumberone*numbertwo

after all of that, I have an ask script that asks the player what the answer is, but I can't add that because the way I entered this didn't have the blocks.
also, this took forever to make, since I had to type this out and learn this new language that is only in the forums.
also sorry, I messed up a little in the code.

You mean something like this? Pretty simple to make: https://scratch.mit.edu/projects/1145491233/editor/
NoUsername-King
Scratcher
100+ posts

How to do exponents?

Okay, exponents can be calculated with
e^oflnofbase*exponent
And root can be calculated with this
e^oflnofbase/root
djollieboy11
Scratcher
9 posts

How to do exponents?

Okay, thank you all for the help! I really appreciate it.

Powered by DjangoBB