A better way to do this pattern?
#2

You are worrying too much too early. Unless you notice that it's a bottleneck, I would not worry about it. However if you want more readable code, I'd go with
pawn Code:
new
    total = 10,
    peak = total / 2
;

for(new i = 0; i < total; i++)
{
    new j = i;
    if (i >= peak) {
        j = total - i;
    }

    printf("%i", j);
}
Reply


Messages In This Thread
A better way to do this pattern? - by Rotzank - 29.09.2017, 03:50
Re: A better way to do this pattern? - by Misiur - 29.09.2017, 06:17

Forum Jump:


Users browsing this thread: 2 Guest(s)