cm0002@lemmy.world to Programmer Humor · 3 months agoRecursionkbin.melroy.orgimagemessage-square16linkfedilinkarrow-up1398arrow-down17
arrow-up1391arrow-down1imageRecursionkbin.melroy.orgcm0002@lemmy.world to Programmer Humor · 3 months agomessage-square16linkfedilink
minus-squareReptorianlinkfedilinkarrow-up3·3 months agoI had this problem only once. Luckily, I do not need recursion. I know my way using iterative process.
minus-squareReptorianlinkfedilinkarrow-up2·3 months agoI actually use repeat(iterations,index_name(optionall),);. No need for i++ or ++i for loop in many cases.
minus-squareReptorianlinkfedilinkarrow-up2·2 months agoYeah. repeat() is unique to a few language. I think just Scala, and G’MIC has it. I use the second one. It’s more convenient than say for(p=0,p<5,++p,);. Sometimes, repeat(5,); suffice.
I had this problem only once. Luckily, I do not need recursion. I know my way using iterative process.
You forgot
i++
I actually use
repeat(iterations,index_name(optionall),);
. No need for i++ or ++i for loop in many cases.😶
Yeah. repeat() is unique to a few language. I think just Scala, and G’MIC has it. I use the second one. It’s more convenient than say
for(p=0,p<5,++p,);
. Sometimes,repeat(5,);
suffice.