Discuss Scratch

gmd65
Scratcher
44 posts

The repeat block

Scratch is horrible at adding very large numbers. Is it the same with the repeat block? Does it repeat a block a few times less or more for huge numbers?
KingOfAwesome58219
Scratcher
1000+ posts

The repeat block

There isn't a really ever an applicable time you'd need to run a repeat block so many times that that the exponential notation truncates the end.



gmd65
Scratcher
44 posts

The repeat block

KingOfAwesome58219 wrote:

There isn't a really ever an applicable time you'd need to run a repeat block so many times that that the exponential notation truncates the end.
Please answer my question.
asivi
Scratcher
1000+ posts

The repeat block

gmd65 wrote:

Scratch is horrible at adding very large numbers. Is it the same with the repeat block? Does it repeat a block a few times less or more for huge numbers?

Try this

repeat ([10 ^ v] of (239))//large number(is it enough large?)
say [hello] for (0.1) secs
say [world] for (0.1) secs
end

and please tell me if it works(repeating as expected).

gmd65 wrote:

KingOfAwesome58219 wrote:

-snip-
Please answer my question.

Last edited by asivi (Feb. 6, 2018 18:22:25)

KingOfAwesome58219
Scratcher
1000+ posts

The repeat block

gmd65 wrote:

KingOfAwesome58219 wrote:

There isn't a really ever an applicable time you'd need to run a repeat block so many times that that the exponential notation truncates the end.
Please answer my question.
Yes, that does happen, because
exponential notation truncates the end
i.e.
repeat (3485223485293525789230572)

end
becomes
repeat (3.48522348529352e+24) // scratchblocks doesn't recognize this as an input because of the 'e'

end
after refreshing the editor, thus getting rid of 5789230572 iterations.

Last edited by KingOfAwesome58219 (Feb. 6, 2018 20:46:40)




asivi
Scratcher
1000+ posts

The repeat block

KingOfAwesome58219 wrote:

repeat (3.48522348529352e+24) // scratchblocks doesn't recognize this as an input because of the 'e'
end
after refreshing the editor, thus getting rid of 5789230572 iterations.

Are you sure?
Do this

set [ v] to [0]
repeat ((join [] [2e+2]) + (0))//or type 2e2 in the input, or remove the sum operator
change [ v] by (1)
end

Last edited by asivi (Feb. 7, 2018 08:16:24)

KingOfAwesome58219
Scratcher
1000+ posts

The repeat block

asivi wrote:

KingOfAwesome58219 wrote:

repeat (3.48522348529352e+24) // scratchblocks doesn't recognize this as an input because of the 'e'
end
after refreshing the editor, thus getting rid of 5789230572 iterations.

Are you sure?
Do this

set [ v] to [0]
repeat ((join [] [2e+2]) + (0))//or type 2e2 in the input, or remove the sum operator
change [ v] by (1)
end
I'm sure.
3.48522348529352e+24 == 3485223485293520000000000, not 3485223485293525789230572.



asivi
Scratcher
1000+ posts

The repeat block


KingOfAwesome58219 wrote:

asivi wrote:

KingOfAwesome58219 wrote:

repeat (3.48522348529352e+24) // scratchblocks doesn't recognize this as an input because of the 'e'
end
after refreshing the editor, thus getting rid of 5789230572 iterations.

Are you sure?
Do this

set [ v] to [0]
repeat ((join [] [2e+2]) + (0))//or type 2e2 in the input, or remove the sum operator
change [ v] by (1)
end
I'm sure.
3.48522348529352e+24 == 3485223485293520000000000, not 3485223485293525789230572.

Do this

set [a v] to [0]
repeat (join [] [3485223485293525789230572])//this way it may work(perhaps) ;)
change [a v] by (1)
end

Tell me the result. Just have a bit of patience.

Last edited by asivi (Feb. 7, 2018 19:12:30)

KingOfAwesome58219
Scratcher
1000+ posts

The repeat block

asivi wrote:

KingOfAwesome58219 wrote:

asivi wrote:

KingOfAwesome58219 wrote:

repeat (3.48522348529352e+24) // scratchblocks doesn't recognize this as an input because of the 'e'
end
after refreshing the editor, thus getting rid of 5789230572 iterations.

Are you sure?
Do this

set [ v] to [0]
repeat ((join [] [2e+2]) + (0))//or type 2e2 in the input, or remove the sum operator
change [ v] by (1)
end
I'm sure.
3.48522348529352e+24 == 3485223485293520000000000, not 3485223485293525789230572.

Do this

set [a v] to [0]
repeat (join [] [3485223485293525789230572])//this way it may work(perhaps) ;)
change [a v] by (1)
end

Tell me the result. Just have a bit of patience.
That appears to work. I'm not arguing its impossible to fix, just that integers work the same way in repeat blocks.



asivi
Scratcher
1000+ posts

The repeat block

KingOfAwesome58219 wrote:

asivi wrote:

-snip-
That appears to work. I'm not arguing its impossible to fix, just that integers work the same way in repeat blocks.

Yes, i agree with you.
Let me point out that i missunderstood your first response, i was thinking about “e+”. Also the original post seemed to me a sort of joke because, who needs such block to repeat a really huge number of times, or to know about it?
Greetings.

edit:
I mean “e+” messing up the block(yet not sure if i explained it well)



Last edited by asivi (Feb. 7, 2018 21:50:36)

Powered by DjangoBB