Fractional repeat blocks

id: 750127

category: Questions about Scratch

posts: 7

I'm not sure if this belongs in the HwS forum or not, but what happens if a repeat block has a decimal in it? If i have this code:
repeat (variable set to 3 point something)

end
then what would happen in the code? Would it round for how many times it would repeat?
I just tested it, and I'm not able to put a decimal point in there in the first place.

Plants4Life1200 wrote:

I just tested it, and I'm not able to put a decimal point in there in the first place.
Yes, but you could use this:
repeat (variable) // set to a decimal

end
So what would happen if you did that?
AAchiefs15 AAchiefs15 loading
testing it, it seems to just round it to the nearest number
malicondii malicondii loading
It rounds the decimal to the nearest whole number. Negatives simply just do not work, and function the same as repeating 0.

NamePending_ wrote:

Plants4Life1200 wrote:

I just tested it, and I'm not able to put a decimal point in there in the first place.
Yes, but you could use this:
repeat (variable) // set to a decimal

end
So what would happen if you did that?
Tested, the variable just rounds to the nearest number.
OK, thanks for the help