Is it Possible to store + or - as varaible? for numbers

for example

local Delta = -
for i = CurrentPosition.Y  delta 1, PossibleMove.Y,  delta 1 do

is there a method to storing + and - as varaible ?

You cant since luaUs grammar doesn’t recognize it. Also wouldn’t it be easier to just type out - and +?

2 Likes

Oh ok Thank you
also the number needs to go positive and negative

1 Like

when i have needed to store the parity of a variable in the past, i would store either the value 1 or -1

it can then be multiplied with the variable who’s parity you are storing

local delta = -1

for i = CurrentPosition.Y + delta, PossibleMove.Y + delta do

here you are only adding or subtracting by 1, so delta*1 becomes delta

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.