basically i want a number to go up until the middle of a for loop then the number goes down
for i = 1, n do
-- example: n = 8
-- from n = 1 to n <= 4 f(i) starts at 0 then goes up to m
-- from n > 4 to n = 8 f(i) starts at m then goes down to 0
end
you already have the pseudocode written out so you could write an if statement where the value is equal to i when i <= n/2 but equal to n-i when i >= n/2
you could also do it with a formula with -1 * math.abs(i-n/2) + n/2