Questions about using LUA (challenges)

What happens

My solution gets rejected by apparently using global variables and fuctions.

What do you understand or find about that problem

The approval of the MR gets neglected due to the use of global variables and functions in my LUA solution, although that the others solutions in codeabbey using LUA are merged despite having the same issue.

You make any workaround? What did you do?

I I know that the way to declare a local variable is by using the following statement:

local var

And i’m only using the standard LUA libraries, which are permitted.

Evidences

Merge Request 5790

I need help with

I need to know how to improve the code solution by learning about what i did wrong.

Hi, when you make an MR a lot of things are evaluated in the peer review, and that things are made manually by each reviewer, for that reason sometimes the strictness of the reviews isn’t the same.

another thing to understand is that our rules are evolving and updating, for that reason a lot of things accepted before probably can’t pass the review today, for that try to figure out how to work with the actual rules and always take a look to the docs in the wiki.

For your particular problem global_vars are considered vars that work in the whole file/code, normally the local vars are declared on functions and passed as parameters or arguments, when you declare vars outside the functions that vars can be modified and used for every function on the file for that try to wrap all vars in functions and try to work with more functional thinking.