I'm pretty sure that this cannot work in any way, but I still wanted to ask just in case, if I am mistaken:
I have heard many times that whenever you have a certain number of lines of very similar code in one batch, you should always scroll through them.
So to speak, I have something like the following.
setPos1(getCard1()); setPos2(getCard2()); setPos3(getCard3()); setPos4(getCard4()); setPos5(getCard5()); setPos6(getCard6()); setPos7(getCard7()); setPos8(getCard8()); setPos9(getCard9()); setPos10(getCard10()); setPos11(getCard11()); setPos12(getCard12());
There is no way to cut lines of code, for example, at the bottom, on the right?
for (i = 0; i < 12; i++) { setPos + i(getCard + i)()); }
I am sure that this will be asked earlier, but neither Google nor SO Search turned out to be with negative evidence.
Thanks for the quick confirmation of this!
source share