Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+2)

show[52 % 2] returns '2' instead of '0' - is that expected behavior for the modulo operation?

(1 edit) (+2)

In Lil, the modulus is the left argument; the opposite order of many other programming languages:

range 15
# (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14)
2 % range 15
# (0,1,0,1,0,1,0,1,0,1,0,1,0,1,0)