lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 04/18/2015 06:38 PM, Hisham wrote:
> I just wrote this, and thought that some of you might enjoy.
> 
> http://hisham.hm/2015/04/18/a-small-practical-example-where-luas-behavior-is-better-than-cs/
> 
> -- Hisham
> 

Indeed, I once spent hours at a game jam debugging that exact same issue
while trying to wrap sprites.

At least in my usage, % is used for "wrapping" an array at least ten
times as often as getting the mathematical modulo.

And floored modulo just plain graphs tidier:
https://en.wikipedia.org/wiki/File:Divmod.svg

~Joseph Wallace