Discuss Scratch
- Discussion Forums
- » Questions about Scratch
- » The repeat block
- 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?
- gmd65
- Scratcher
44 posts
The repeat block
Please answer my question. 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.
- asivi
- Scratcher
1000+ 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?
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).
-snip-Please answer my question.
Last edited by asivi (Feb. 6, 2018 18:22:25)
- KingOfAwesome58219
- Scratcher
1000+ posts
The repeat block
Yes, that does happen, becausePlease answer my question. 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.
exponential notation truncates the endi.e.
repeat (3485223485293525789230572)becomes
end
repeat (3.48522348529352e+24) // scratchblocks doesn't recognize this as an input because of the 'e'after refreshing the editor, thus getting rid of 5789230572 iterations.
end
Last edited by KingOfAwesome58219 (Feb. 6, 2018 20:46:40)
- asivi
- Scratcher
1000+ posts
The repeat block
repeat (3.48522348529352e+24) // scratchblocks doesn't recognize this as an input because of the 'e'after refreshing the editor, thus getting rid of 5789230572 iterations.
end
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
I'm sure.repeat (3.48522348529352e+24) // scratchblocks doesn't recognize this as an input because of the 'e'after refreshing the editor, thus getting rid of 5789230572 iterations.
end
Are you sure?
Do thisset [ v] to [0]
repeat ((join [] [2e+2]) + (0))//or type 2e2 in the input, or remove the sum operator
change [ v] by (1)
end
3.48522348529352e+24 == 3485223485293520000000000, not 3485223485293525789230572.
- asivi
- Scratcher
1000+ posts
The repeat block
I'm sure.repeat (3.48522348529352e+24) // scratchblocks doesn't recognize this as an input because of the 'e'after refreshing the editor, thus getting rid of 5789230572 iterations.
end
Are you sure?
Do thisset [ v] to [0]
repeat ((join [] [2e+2]) + (0))//or type 2e2 in the input, or remove the sum operator
change [ v] by (1)
end
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
That appears to work. I'm not arguing its impossible to fix, just that integers work the same way in repeat blocks.I'm sure.repeat (3.48522348529352e+24) // scratchblocks doesn't recognize this as an input because of the 'e'after refreshing the editor, thus getting rid of 5789230572 iterations.
end
Are you sure?
Do thisset [ v] to [0]
repeat ((join [] [2e+2]) + (0))//or type 2e2 in the input, or remove the sum operator
change [ v] by (1)
end
3.48522348529352e+24 == 3485223485293520000000000, not 3485223485293525789230572.
Do thisset [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.
- asivi
- Scratcher
1000+ posts
The repeat block
That appears to work. I'm not arguing its impossible to fix, just that integers work the same way in repeat blocks. -snip-
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)
- Discussion Forums
- » Questions about Scratch
- » The repeat block