Discuss Scratch

-ErrorPurpl_157
Scratcher
100+ posts

I think this should be added

I propose this block

When (a) is a multiple of (b) :: control hat

The block works when b divided by a is an integer
bobcat0701
Scratcher
1000+ posts

I think this should be added

do you have an example of when and where this might be used
-ErrorPurpl_157
Scratcher
100+ posts

I think this should be added

bobcat0701 wrote:

do you have an example of when and where this might be used
Idk sorry
-Valtren-
Scratcher
1000+ posts

I think this should be added

workaround:
if <not <((A) / (B)) contains (.)? :: operators>> then
end
if A is a multiple of B then it will return true, otherwise it will return false.
here's a screenshot in case the scratchblocks don't look very clear:
CST1229
Scratcher
1000+ posts

I think this should be added

-Valtren- wrote:

(#4)
workaround:
if <not <((A) / (B)) contains (.)? :: operators>> then
end
if A is a multiple of B then it will return true, otherwise it will return false.
here's a screenshot in case the scratchblocks don't look very clear:
I think a better workaround would be:
<((A) mod (B)) = [0]>
IndexErrorException
Scratcher
500+ posts

I think this should be added

Workaround is very simple with the modulus method or the more easy to understand division with a point test. Plus hat blocks just suck anyway because you can't control when you choose to sample the result.
-ErrorPurpl_157
Scratcher
100+ posts

I think this should be added

I’m closing this tomorrow

Powered by DjangoBB