Need help writing more efficient code (total newbie)

guix:
Hello and welcome :slight_smile:

Where is i declared?

And, it may be ugly, yet it's most efficient this way, than using for loops.

You can still use #define instead of const int, to save little program memory :slight_smile:

'const int' occupies no memory so it won't save a thing!