Fractional repeat blocks
id: 750127
category: Questions about Scratch
posts: 7
NamePending_
loading
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)then what would happen in the code? Would it round for how many times it would repeat?
end
Plants4Life1200
loading
I just tested it, and I'm not able to put a decimal point in there in the first place.
NamePending_
loading
Yes, but you could use this: I just tested it, and I'm not able to put a decimal point in there in the first place.
repeat (variable) // set to a decimalSo what would happen if you did that?
end
AAchiefs15
loading
testing it, it seems to just round it to the nearest number
malicondii
loading
It rounds the decimal to the nearest whole number. Negatives simply just do not work, and function the same as repeating 0.
Plants4Life1200
loading
Tested, the variable just rounds to the nearest number.Yes, but you could use this: I just tested it, and I'm not able to put a decimal point in there in the first place.repeat (variable) // set to a decimalSo what would happen if you did that?
end
NamePending_
loading
OK, thanks for the help