Discuss Scratch

JRR078
Scratcher
56 posts

more math blocks.

I use math blocks a bit. but there aren't blocks like…
(() ^ ())
([cube root v] of (9))
(() !)
(btw, () ! is take 5! = 5*4*3*2*1=120 (i'm pretty sure.) The ()^() can be replaced with the following:
define (base) ^ (exponent)
set [Total v] to [1]
repeat (exponent)
set [Total v] to ((Total) * (base))
end
IDK about the cuberoot of () and ()!

Last edited by JRR078 (Oct. 30, 2016 20:51:17)


when green flag clicked
forever
see [how many times I change my signature v]
end
“Video games are meant to be just one thing: fun. Fun for everyone.” - Satoru Iwata
One day, I will learn the art of correctly using the “quote” section consistently
TheMonsterOfTheDeep
Scratcher
1000+ posts

more math blocks.

If we implement the first one, we should not implement the second one, because then it can be workarounded as so:
((base :: grey) ^ ((1) / (3)) :: operators)
Also your workaround for exponent will not work for decimal or negative exponents. One that works for decimal exponents (but will break for negative bases) is this:
([e ^ v] of ((exponent :: grey) * ([ln v] of (base :: grey)))
Finally, I'm not sure how useful the factorial function is, but I think if it's implemented it should be labelled as factorial but actually call the Gamma function (which basically is factorial that works on decimals / negatives).

my latest extension: 2d vector math
JRR078
Scratcher
56 posts

more math blocks.

Ok! makes sense!

when green flag clicked
forever
see [how many times I change my signature v]
end
“Video games are meant to be just one thing: fun. Fun for everyone.” - Satoru Iwata
One day, I will learn the art of correctly using the “quote” section consistently
braxbroscratcher
Scratcher
1000+ posts

more math blocks.

JRR078 wrote:

I use math blocks a bit. but there aren't blocks like…
(() ^ ())
([cube root v] of (9))
(() !)
(btw, () ! is take 5! = 5*4*3*2*1=120 (i'm pretty sure.) The ()^() can be replaced with the following:
define (base) ^ (exponent)
set [Total v] to [1]
repeat (exponent)
set [Total v] to ((Total) * (base))
end
IDK about the cuberoot of () and ()!
Cube root is literally a number to the 1/3 power. Already easily workaroundable; no support.


My signature is kumquat proof.
But not tangerine pro-
nomnomnomnomnom










Current Project:
n/a
Quotes: “In our last hour, we burn the most brightly, trying to deny that we are burning out.” -Me
“Well, no. 1024 Killerbytes make a Murderbyte.” -MegaByteCorporations
“I hate out of context quotes.” -Me
“I hate it when Cubeupload breaks.” -Also me
JRR078
Scratcher
56 posts

more math blocks.

lol the quote

Last edited by JRR078 (Oct. 31, 2016 15:35:22)


when green flag clicked
forever
see [how many times I change my signature v]
end
“Video games are meant to be just one thing: fun. Fun for everyone.” - Satoru Iwata
One day, I will learn the art of correctly using the “quote” section consistently

Powered by DjangoBB